[lltx] Font names database

Khaled Hosny khaledhosny at eglug.org
Thu Jan 14 05:29:01 CET 2010


On Wed, Jan 13, 2010 at 08:02:08PM +0200, Elie Roux wrote:
> Khaled Hosny a écrit :
> >That is an interesting idea, I have a more or less similar idea, but I
> >need to think more about it though.
> 
> Ok, do not hesitate to share very technical ideas and to describe
> your technical solution, I'm interested in contributing.

Sure.

> >I've considered using fontconfig (actually my first version were using
> >fc-list to list all system font files), but I disregarded it later as we
> >can't guarantee fontconfig (or fontconfig tools) are present on all
> >systems,
> 
> That's for sure, but on the systems where it is, it implies that
> ""all"" the fonts are listed by it, except eventually the ones in
> the TEXMF tree that are not always added to the fc database, that's
> why I liked the idea... Also I think the script would take less
> loading time right? A fontforge call for each font seems like a bit
> overkill to me if there is already a database available... Of course
> we would still have to do it manually on poor OSs...

We have to do TEXMF fonts on our own anyway (unless there is away to add
it to fc cache without fiddling with user's configuration files). A full
fontforge call it too much indeed, but LuaTeX has a fontforge.info which
is much faster (processing more than 2000 files toke less than 2 seconds
on my machine), but it doesn't currently provide all the information we
need (names table for example), but we may try to extend it, I'm sure
Taco will accept some patch.
> Furthermore it would be more compliant with XeTeX.

Not sure about this, looking at XeTeX sources I see 
// for sfnt containers, we'll read the name table ourselves, not rely on Fontconfig

(sfnt containers are almost all XeTeX supported fonts except tfm and
type1 fonts)

> > also fontconfig tries to do smart things that wouldn't fit our
> >needs and we better off parsing font files ourselves.
> 
> I don't understand this... fc-cat (or fc-list -v) displays too much
> information, but we can still parse it, all the work is almost
> done... what doesn't fit it the informations given by fc?

For example, what if the font have not subfamily, what fc will return
(type1 fonts for example)? What if the font is available in several
formats (TTF, OTF, etc. as many fonts in TeXlive do), what are the
meaning of some values; for lmb10.pfb for example I get "weight: 180,
width: 100" (I expect Bold and Regular respectively), what are the
meaning of those values? And the fact that we will be loading the fonts
with fontforge not fontconfig (TTC subfont indices for example, do fc
support dfont fonts?)

Lots of question and very little documentation.

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer



More information about the lualatex-dev mailing list