1

Referring to this thread: Xelatex vs Lualatex relatively to PetiteCaps

I solved the problem by proceeding as follows:

  • I kept both the Texlive version of EB Garamond (/usr/local/texlive/2021/texmf-dist/...) and the one, most recent, I installed by myself (/usr/local/share/fonts/...) ;

  • I cleared the cache of /var/cache/fontconfig/;

  • I deleted ~/.texlive2021;

  • I regenerated the cache with fc-cache -sfv.

At this point, Xelatex compiles in any case with the Texlive version: in fact the log file (compilation performed with the \ XeTeXtracingfonts = 1 option):

Requested font "EB Garamond / OT: script = latn; language = dflt;" at 10.00002pt -> /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/EBGaramond-Regular.otf

The same code, compiled with Luatex, instead uses my more recent version:

avail lists: 1: 1,2: 56,3: 12,4: 1,5: 23,6: 6,7: 194,9: 26,11: 20 </usr/local/share/fonts/opentype/EBGaramond/EBGaramond-Regular.otf>

Now the example file compiles correctly, with the PetiteCapital, with both compilers. What I still don't understand is why the two compilers use files in different directories without any indication.

In fact, I observe that, with the font cache regenerated - and without ~/.texlive2021 in my HOME - Xelatex starts immediately and compiles, while Lualatex first creates (with a few seconds of work) its own cache in ~/.texlive2021 and only then starts the compilation of the .tex file.

It would be interesting to know where the PATH indication, that the two compilers follow to manage the fonts, resides and the reasons for this different behavior .

Thank you

2
  • 1
    You might be able to regenerate the Luaotfload cache with luaotfload-tool -f -u -v. Adding -p should prefer the versions in the TeX Live directory to those in the system directory.
    – Davislor
    Feb 9 at 0:33
  • This unlocks the mystery! Thank you
    – user41063
    Feb 9 at 11:59

1 Answer 1

2

Lua(La)TeX uses its own font list which is generated by luaotfload-tool and which can be scanned by

bash-3.2$ luafindfont EBGaramond
We are using Lua 5.3
Looking for font "ebgaramond"
Check for file /usr/local/texlive/2021/texmf-var/luatex-cache/generic/names/luaotfload-names
 No.                       Fontname           Symbolic Name                                                                  Path
   1.            EBGaramond-Bold.otf              ebgaramond  /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/
   2.      EBGaramond-BoldItalic.otf              ebgaramond  /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/
   3.       EBGaramond-ExtraBold.otf              ebgaramond  /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/
   4. EBGaramond-ExtraBoldItalic.otf              ebgaramond  /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/
   5.        EBGaramond-Initials.otf      ebgaramondinitials  /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/
   6.          EBGaramond-Italic.otf              ebgaramond  /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/
   7.          EBGaramond-Medium.otf              ebgaramond  /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/
   8.    EBGaramond-MediumItalic.otf              ebgaramond  /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/
   9.         EBGaramond-Regular.otf              ebgaramond  /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/
  10.        EBGaramond-SemiBold.otf              ebgaramond  /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/
  11.  EBGaramond-SemiBoldItalic.otf              ebgaramond  /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/
  12.                 EBGaramond.otf              ebgaramond                                   /Users/voss/Library/Fonts/Garamond/
  13.       EBGaramond08-Regular.otf              ebgaramond                                   /Users/voss/Library/Fonts/Garamond/
  14.            EBGaramond08-SC.otf              ebgaramond                                   /Users/voss/Library/Fonts/Garamond/
  15.         EBGaramond12-AllSC.otf       ebgaramond12allsc                                   /Users/voss/Library/Fonts/Garamond/
  16.        EBGaramond12-Italic.otf              ebgaramond                                   /Users/voss/Library/Fonts/Garamond/
  17.       EBGaramond12-Regular.otf              ebgaramond                                   /Users/voss/Library/Fonts/Garamond/
  18.            EBGaramond12-SC.otf              ebgaramond                                   /Users/voss/Library/Fonts/Garamond/
  19.            EBGaramondAllSC.otf         ebgaramondallsc                                   /Users/voss/Library/Fonts/Garamond/
  20.             EBGaramondBold.otf              ebgaramond                                   /Users/voss/Library/Fonts/Garamond/
  21.       EBGaramondInitialsF1.otf ebgaramondinitialsfill1                                   /Users/voss/Library/Fonts/Garamond/
  22.       EBGaramondInitialsF2.otf ebgaramondinitialsfill2                                   /Users/voss/Library/Fonts/Garamond/
  23.           EBGaramondItalic.otf              ebgaramond                                   /Users/voss/Library/Fonts/Garamond/
  24.               EBGaramondSC.otf            ebgaramondsc                                   /Users/voss/Library/Fonts/Garamond/
bas

Xe(La)TeX uses fontconfig for searching the system fonts and the default kpsefind for the TeX fonts. This one will only be found by its filename and not the symbolic name whereas Lua(La)TeX will find TeX fonts also by its symbolic name, e.g. \setmainfont{EBGaramond}

5
  • Thanks for the extensive reply. One thing is still not clear to me: okay, Luatex has a wider font recognition system: but what leads it, in my case, to choose one rather than the other of the EB Garamond that I have installed, for in my system there are two different versions?
    – user41063
    Feb 8 at 21:11
  • The first one in the font list will win
    – user187802
    Feb 8 at 21:13
  • I read: <1. EBGaramond-Bold.otf ebgaramond /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/ebgaramond/ 2. EBGaramond-Bold.otf ebgaramond /usr/local/share/fonts/opentype/EBGaramond/> , but lualatex compiles with the second one: <avail lists: 1:1,2:230,3:40,4:26,5:225,6:20,7:5040,8:1,9:143,10:20,11:615 </usr/local/share/fonts/opentype/EBGaramond/EBGaramond-Regular.otf></usr/local/ share/fonts/opentype/EBGaramond/EBGaramond-Bold.otf>
    – user41063
    Feb 8 at 21:46
  • The list in my answer is a sorted list, not the order in which luaotfload finds the files. And that is a unsorted internal list.
    – user187802
    Feb 9 at 7:26
  • now everything is clear to me, thanks
    – user41063
    Feb 9 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.