freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Re: Character widths are wrong in this font.


From: Werner LEMBERG
Subject: [Devel] Re: Character widths are wrong in this font.
Date: Fri, 19 Nov 2004 17:52:50 +0100 (CET)

[Ian sent the font to me privately.]

> In windows, if you double click this font you will see that the
> character spacing is much less than freetype reports. I have
> attached a screenshot from windows XP in case you don't have
> convenient access to a windows machine. If you look at the font in
> ftview you will see that the character widths are about 3 times that
> of windows.  In fact, they look 'obviously' too wide.

The font is buggy.  It sets the `isFixedPitch' in the `post' table.
At the same time it sets the `advanceWidthMax' in the `hmtx' table to
a value which is three times the value of the actual width.

To support old CJK fonts properly (which are often buggy too),
FreeType by default returns the `advanceWidthMax' value as the width
of all glyphs in a monospaced font.  It is debatable whether this is a
good default, but today it can't be changed without breaking many
programs.

What you need is to specify the `FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH'
flag to make FreeType always return the metric values from the `hmtx'
table.

I have updated the documentation of this flag since it is misleading.
The ft2demos programs now have this flag always set.


    Werner



reply via email to

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