freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] CJK 'monospace' fonts and horiAdvance ....


From: Werner LEMBERG
Subject: Re: [Devel] CJK 'monospace' fonts and horiAdvance ....
Date: Sun, 01 Jun 2003 16:35:08 +0200 (CEST)

> I've just found a bug in Freetype 2.1.2 (I'm sorry I haven't checked
> the CVS, yet, but it's likely that it's not yet fixed because
> 2.1.4rc2 release note didn't mention it).

I'm not sure whether this is a bug...

> Some East Asian fonts have 'monospace' bit/flag set although they're
> not literally monospace fonts. (semantically they're monospace
> fonts).  They're rather dual-width / bi-width fonts.  Simply put,
> Latin letters and western digits have exactly half as wide as
> Chinese characters, Katakana/Hirakana and Hangul syllables.  It
> appears that FT2 is a bit too 'innoncent' to believe that
> 'monospace' bit/flag being set means every glyph in a font has the
> same advance width (horiAdvance).  For CJK fonts, this is not the
> case.  I found this problem while trying to figure out why
> fontconfig 2.2 doesn't work as expected while 2.1.90 to 2.1.92
> worked correctly (before that, fontconfig made the same assumption
> as is made by FT2.). [0]
> 
> I propose that for CJK "monospace" fonts, FT2 does the following:
>
> [...]

Thanks for the algorithm, but I'm hesitating to add code to FT2.  I
wonder whether this should rather be done one level higher, in either
the application or a library like Xft or Qt.  Reason is that a lot of
additional constraints must be checked if you want to avoid checking
all glyphs, for example a test that a particular font is indeed a CJK
font.

What I can easily do is to add a remark to the explanation of the
FT_IS_FIXED_WIDTH macro that its result is not reliable, especially
not for CJK TrueType fonts.

An example of a brute-force method is available in file
`ftcheckfixedwidth.c' (from ft2demos).


    Werner



reply via email to

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