freetype
[Top][All Lists]
Advanced

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

Re: need help! (font width vs. font height)


From: Pavel Kankovsky
Subject: Re: need help! (font width vs. font height)
Date: Fri, 3 Nov 2000 11:21:07 +0100 (MET)

On Thu, 2 Nov 2000 address@hidden wrote:

> * i use FT_Set_Pixel_Sizes(font_face,font_width,0) to set the font
>   size.

This means font_height is set to the same value as font_width. Keep
reading, I am going to provide an explanation.

> what happens, i think, is that the user 'font_width' is really being
> respected only in 'font_height', since obviously the characters are
> taller than wider.

Both numbers, font_width and font_height, are in pixels per "em".

"Em" is a traditional typographical unit defined as the length of either
side of the smallest square bounding any of the glyphs (this square is
called "em square" or "em quad"). It used to correspond both to the width
(without serifs) and to the height of "M" in the ancient capital-only
Roman script. Today, with descents (i.e. stems going below the
baseline) and diacritical marks, there is a little bit of confusion about
the meaning of "em": sometimes, it means the side of the bounding
square including descents and diacritical marks (e.g. em in early
(?) W3C CSS spec drafts), sometimes it means the width of capital
"M" (e.g. em in TeX).

AFAIK, FreeType uses the font's own definition of em for TrueType fonts
that appears to correspond to the size of "M" in most cases (but a crazy 
font designer can use a completely different definition :P). I have to
admit I have no idea what approach is used for other font formats.

In order to get a specific width of glyphs, you need to translate the
desired width into em's (or the font's notion of thereof).

--Pavel Kankovsky aka Peak  [ Boycott Microsoft--http://www.vcnet.com/bms ]
"Resistance is futile. Open your source code and prepare for assimilation."




reply via email to

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