[XeTeX] Finding out if a font supports a particular Unicode character and using it

Taco Hoekwater taco at elvenkind.com
Tue Feb 2 12:33:00 CET 2010


Chris Jones wrote:
> 
> It would appear that for large font files, fontforge needs at least half
> a gig of memory. There may be good reasons for that but it does strike
> me as a bit odd that you would need that much to process somewhere in
> the neighborhood of 20 Meg of input data.

That is probably because it also loads all of the glyph information and
drawing instructions its into internal structures. I had similar memory
problems when I first incorporated the fontforge font loader into
luatex. These were fixed by later patches after (mostly) complaints from
CJK users.

In fact, now that I think about it: you may have better luck building
a tool based on texlua. For a simple (non-cid) font, you can get a list
of unicode characters like so:

   f = fontloader.open(arg[1])
   l = fontloader.to_table(f)
   for _,v in pairs(l.glyphs) do
     print (v.name .. ' ' .. v.unicode)
   end

just save in a file (fontcharinfo.lua) and run

   $ texlua fontcharinfo.lua <fontfilename>

Best wishes,
Taco



More information about the XeTeX mailing list