[Dev-luatex] encoding code issue

Taco Hoekwater taco at elvenkind.com
Fri Jun 19 17:16:04 CEST 2009

Hi Yue Wang,

Yue Wang wrote:
> hi Taco:
> - when I change something in fontforge/Unicode/*, and run build.sh
> --make, it will recompile many luatex stuffs. That is not necessary.
> please fix that if you can.

Sorry, I can't fix that (at least not right now). The dependencies are
auto-generated and luatex's C library as a whole depends on libff.a.

> - cjk.c can be removed completely. Chinese TTF/OTF Fonts are arranged
> in unicode order (maybe with other encoding charmap provided). So no
> need to do font re-encoding.  (I think Japanese fonts and Korean fonts
> do too)

I have not actually removed the source code (just in case there is
a problem discovered later) but I have completely hidden it from the
compiler so that it is no longer compiled in the binary.

So, Yanrui Li (and maybe for you as well, just to verify I did not mess
up anything): if you want to run your tests, you only have to grab the
current trunk and recompile. Probably the most important thing to test
is whether searching in Acroread still works as it should.

> - source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/backtrns.c
> is not needed, please remove that.

Done. I also removed the dump.c file that is used to generate some of
these support data files.

> - maybe it is not necessary to extend ctype to utype: in ConTeXt we
> have char-def.lua which gives very detailed information. 

I have decided to keep that code: at some time in the future I want
to expose the fontforge Unicode library to the lua scripting language.
The current unicode library (slunicode) is minimalistic, already
outdated, and hard to keep up-to-date, so it makes sense to switch
to the much cleaner version from Fontforge at some point (not too
soon though, it has a rather low priority).

> - unialt.c is only needed for autohint.c. since hinting have nothing
> to do with typesetting, perhaps these two files can be gone too...

Autohint.c (and tocff.c) is really needed: for some odd legacy
fonts, I generate a CFF font on the fly.

But unialt.c was is used only for the FindBlues() function, and for
that, the test for unicode alternates was definately overkill, so
unialt.c is gone now.

> After removing these files I ended up building a 3.9M luatex  on Mac OS X.
> Maybe Linux binary can be even smaller.

The size of my cross-compiled windows binary dropped by some 750K
thanks to all this. I can't easily check linux binary sizes because
I always compile with debugging symbols on and optimization off
(except for releases).

> of course, the above thoughts have not been throughly tested.

Best wishes, thanks for the digging up the information,


More information about the dev-luatex mailing list