[Dev-luatex] problem with loading Chinese Fonts.

Hans Hagen pragma at wxs.nl
Tue Aug 14 21:32:56 CEST 2007


Sherry Zhang wrote:

>               width = glyph_table.width * mag,

width = (glyph_table.width or 0) * mag,

> but then I load a Chinese font, simhei.ttf. It is also available in
> the English Edition of Windows XP.
> and now luatex reports:
> Warning: Glyph 257 is named middot which should mean it is mapped to
> Unicode U+00B7, but Glyph 194 already has that encoding.

i dunno about this one, but fonts can have bugs and any of the fonts
that i use report inconsistencies

> and then it crash:
> This went wrong:[string "luas[0]"]:1: attempt to perform arithemetic
> on field 'width'  (a nil value).
> <to be read again>
>                            \simhei
> 
> So it fails to compile.

see above, you can catch this, it;s not a luatex issue but a lua issue

>           mag = size / 2048
> to
>           mag = size / 256
> then the space looks right.

choosing the right spacing is an art -)

keep in mind that many tfm files hav evalues chosen at some point, and
not always related to the font info; with open type choices need to be
made based on info in the font

> Step 4
> I tried more Chinese ttf fonts and found that only a few can pass the
> test, and among those few, the character box width seems all wrong.
> So how can I make things right? or it is just a bug in luatex?

a bug and it's being worked on

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the dev-luatex mailing list