[lltx] lualatex and system fonts.

luigi scarso luigi.scarso at gmail.com
Sat Apr 15 01:28:17 CEST 2023

Hi,  I apologize in advance if I misread the documentation,
but it seems that in linux luaotfload-tool always runs fontconfig,
mixing in this ways the fonts of the (currently active) texlive with the
systems fonts.
Coming form 20+ of context where the behaviour is "use only the fonts of
the (currently active) context" and given that luaotfload inherits from
context,  this behaviour  looks .. weird.
luaotfload-parser.lua  says

  For fonts installed on the operating system, there are several
  options to make Luaotfload index them:

   - If OSFONTDIR is set (which is the case under windows by default
     but not on the other OSs), it scans it at the same time as the
     texmf tree, in the function scan_texmf_fonts().

   - Otherwise
     - under Windows and Mac OSX, we take a look at some hardcoded
     - under Unix, it reads /etc/fonts/fonts.conf and processes the
       directories specified there.

  This means that if you have fonts in fancy directories, you need to
  set them in OSFONTDIR.

  Beware: OSFONTDIR is a kpathsea variable, so fonts found in these
  paths, though technically system fonts, are registered in the
  category “texmf”, not “system”. This may have consequences for the
  lookup order when a font file (or a font with the same name
  information) is located in both the system and the texmf tree.

where is  seems that if I set OSFONTDIR  to let's say /tmp/foo I can avoid
fontconfig at all,
but the manual says
Search Paths
luaotfload scans those directories where fonts are expected to be located
on a given sys-
tem. On a Linux machine it follows the paths listed in the Fontconfig
configuration files;
consult man 5 fonts.conf for further information. On Windows systems, the
location is Windows\\Fonts, while Mac OS X requires a multitude of paths to
be exam-
ined. The complete list is is given in table 1. Other paths can be
specified by setting the
environment variable OSFONTDIR. If it is non-empty, then search will be
extended to the
included directories.

and this is what actually happens with TL 2023.
I am not able to see if there is any way for lualatex to completely avoid
fontconfig (and the hardcoded directories in Windows and Mac) and use
exclusively the fonts of texlive.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/lualatex-dev/attachments/20230415/410eb792/attachment.html>

More information about the lualatex-dev mailing list.