freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] Text positioning problem


From: Robert . Szeleney
Subject: [Devel] Text positioning problem
Date: Wed, 5 May 2004 16:08:22 +0200



Hi!

We are evaluation the freetype font engine for a possible use in our
visualization for our automated machines. (www.br-automation.com). We are
testing for weeks already and in general we are very happy with it.

But we ran into a few problems which we hope can be solved with your help.
The main problem is positioning.

Background:
Our customers will draw "process visualisation pictures" with a tool using
Microsoft Windows. There the customer can place various controls with text
like a button, textfield, input field. Additionally, the customer can
select the text alignment (top, center, bottom).

We now have heavy problems computing the pixel position for these texts.
Each method we tried worked with a set of fonts (e.g. arial, tahoma,...)
but didn't work with other. (chinese fonts, winfonts,....). When we use
another method, this fonts works but the others don't work.

So my question is, which way should be used to compute the pixel
positions/size for the texts?

In detail we need to know:
- How big is a text?    E.g. a 'A' ==> 12 px,  '_' ==> 1px

- How big can all characters from a font be at maximum?   E.g. 18

- How big is the maximum ascender in pixels for all characters in a font?

- How big is the maximum descender in pixels for all characters in a font?

- To sum up:
   We need to position text in a rectangle depending on the aligment. The
position itself should always be the same, regardless which text is draw.
   For example:
       If you draw just an underscore ( _ ), this underscore should be on
the same vertical position as when you would draw on underscore in
following text::  ABaby____abab


I really hope you can help us as we are really pressed for time, and
reading your documents and various sources didn't really help us.

Btw, maybe we can talk by using ICQ / IRC?

Thank you very much!

Robert Szeleney
B&R Austria
http://www.br-automation.com

P.s.: Sorry for the cross-posting.










reply via email to

[Prev in Thread] Current Thread [Next in Thread]