[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] RE: Character widths are wrong in this font.
From: |
Ian Brown |
Subject: |
[Devel] RE: Character widths are wrong in this font. |
Date: |
Mon, 22 Nov 2004 09:01:41 +0100 |
Hi Werner,
Thanks for looking into this issue so quickly.
I don't currently deal with CJKV, so I should be able to safely set the
required flag. Just a thought though - would it be possible to make the
default behavior depend on whether the font was western encoded or CJKV
- that way we may be able to get the best of both worlds.
Ian
-----Original Message-----
From: Werner LEMBERG [mailto:address@hidden
Sent: 19 November 2004 17:53
To: Ian Brown
Cc: address@hidden
Subject: Re: Character widths are wrong in this font.
[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