[lltx] Ignoring select fonts

Khaled Hosny khaledhosny at eglug.org
Sun May 16 17:48:59 CEST 2010

On Sun, May 16, 2010 at 09:53:24PM +0930, Will Robertson wrote:
> Hi,
> Mac OS X contains a font called "LastResort.ttf" that takes a looooong time to be cached (it contains a glyph for every since unicode code point). So long I've never sat through the caching process.
> To fix this up, I tried writing some naive code to allow fonts to be ignored; I didn't get far before running into issues, however. (At first I used a basic inline conditional but thought that looked like too much of a back.)
> The idea was to filter out the contents of `list`:
>     list = remove_ignore_fonts(list)
>     for _,fnt in ipairs(list) do
>         fnt = path_normalize(fnt)
>         load_font(fnt, fontnames, status, newfontnames, newstatus, texmf)
>     end
> With something like this:
> if os.name == "macosx" then
>     ignorefonts = {
>       "/System/Library/Fonts/LastResort.ttf"
>     }

Depending on filenames and absolute paths is not a good idea as we deal
with fonts whose unique identifier is not filename. We can instead have
a special "black listing" configuration file that lists known
problematic fonts by font name, we can then make a check just after the
fontloader.info() call and if we found a matching name we skip it.
fontloader.info() is quite cheap.

A lua file with a simple table is the simplest, we can even allow having
multiple versions in the texmf tree and concatenate them, so users can
blacklist fonts they don't want (I wanted to do so for a while).


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

More information about the lualatex-dev mailing list