freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Half-width ASCII in monospace CJK fonts


From: Anthony Fok
Subject: [Devel] Half-width ASCII in monospace CJK fonts
Date: Fri, 8 Nov 2002 12:57:47 +0800
User-agent: Mutt/1.4i

Hello David and Werner,

Quite a few popular CJK fonts, including some latest offerings from
Arphic (e.g. HKSCS-2001 fonts published in 2002), have
face->postscript.isFixedPitch set to "true" to mean fixed full-width
Hanzi characters, and fixed half-width ASCII/Latin characters (vs. some
CJK fonts with proportional width ASCII/Latin characters where
face->postscript.isFixedPitch is set to "false".)

This often lead to some problems when using such fonts in CJK locales.
For example, a menu bar normally displayed as:

    [ File  Edit  View                        Help ]

becomes

    [  F i l e    E d i t     V i e w         H e l p  ]

even when FreeType 2 is used for rendering.  (i.e. not the X11 XLFD *-c-*
charcell font problem.)

This issue has been brought up before by Graham Asher, but
unfortunately, he didn't get very far.  See the thread starting here:

    http://www.freetype.org/pipermail/devel/2001-March/001768.html

I do not advocate ignoring the postscript.isFixedPitch flag.  Rather, I
propose reversing the default of "FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH".
Let me explain.  With respect to the following comment in the current
freetype.h:

  *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
  *     Indicates that the glyph loader should ignore the global advance
  *     width defined in the font.  As far as we know, this is only used by
  *     the X-TrueType font server, in order to deal correctly with the
  *     incorrect metrics contained in DynaLab's TrueType CJK fonts.

I do not entirely agree with the above explanation.  I do not have
DynaLab's TrueType CJK fonts at hand, but I believe that the use of
postscript.isFixedPitch in a TrueType font's "post" table to indicate
"Fixed half-width ASCII/Latin chars, Fixed full-width CJK chars" is
quite reasonable and not "incorrect".  Furthermore, I believe that it
is reasonable to trust the font's own advance width for each glyph to
be correct.

So, in my opinion, FreeType should ignore the global advance width by
default, and should only force global advance width only if explicitly
demanded.  It would be nice to see something like a new

        FT_LOAD_FORCE_GLOBAL_ADVANCE_WIDTH
                ^^^^^
to supercede FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH.

Anyhow, it would also be nice, when the "force global advance width"
is on, that FreeType could respect the distinction between "full-width"
and "half-width" as described in

        Unicode Standard Annex #11 East Asian Width
        http://www.unicode.org/unicode/reports/tr11/

and  http://www.unicode.org/Public/3.2-Update/EastAsianWidth-3.2.0.txt
But yes, that does add a bit of complexity to FreeType.  Hmm...


Anyhow, please do seriously consider reversing the default setting, and
implementing something similar to FT_LOAD_FORCE_GLOBAL_ADVANCE_WIDTH.
I have been using a kludgy patch in the FreeType package on Thiz Linux
and on Debian to get around this problem.  (See attachments... please
do not apply them; they are ugly hacks)  But yes, it would be nice if
this problem could be solved in FreeType for good.  :-)

Cheers,

Anthony

-- 
Anthony Fok Tung-Ling
ThizLinux Laboratory   <address@hidden> http://www.thizlinux.com/
Debian Chinese Project <address@hidden>       http://www.debian.org/intl/zh/
Come visit Our Lady of Victory Camp!           http://www.olvc.ab.ca/



reply via email to

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