freetype
[Top][All Lists]
Advanced

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

adjusting a font size to fit it in a box


From: Idigoras Inaki
Subject: adjusting a font size to fit it in a box
Date: Mon, 28 Feb 2000 11:21:04 +0100

Hello,

I am working with the Freetype engine and I have a problem:

I want to fit the font size to a box. I am given the box size (in pixels) to
where I have to write text (only one line); how can I get the font size to
make sure that all chars of that font (glyphs) fit in the box?

I thought that the True Type header´s yMin and yMax ( or the horizontal
header´s ascent and descent) could be used, but I do not know what these
values are related to.

So, to make it clear, I want to know the font size (points) to call
TT_New_Instance(...) making sure that all glyphs will fit in the box, and
the size is the maximum possible (the highest font will touch the box´s
upper bound and the lowest will touch the bottom bound). Most often the
highest char I use is the 'Ñ' character (N with slash).

Thanks in advance. I am looking forward to hearing from you,

 __________________________________
 Iñaki Idigoras Igartua  <address@hidden>
 IKERLAN - E&K Dpt.  (http://www.ikerlan.es)
 P.Box 146, 20500 Arrasate - Gipuzkoa
 Phone +34 943 712400 - Fax. +34 943 796944




reply via email to

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