[tex-live] 3.4.4 System font configuration for XeTEX and LuaTEX
jfbu
jfbu at free.fr
Sun May 15 16:38:03 CEST 2016
Hi
Le 14 mai 2016 à 09:37, Zdenek Wagner <zdenek.wagner at gmail.com> a
écrit :
>> 2016-05-14 0:49 GMT+02:00 Karl Berry <karl at freefriends.org>:
>> because in recent years I don't think that was the case.
>>
>> I suppose you're right. I'll have to ask about what can be
>> sensibly said instead. Thanks.
>>
>> Else one must use filenames, or fontspec with ExternalLocation
>>
>> Well, that's preferable anyway :). --karl
> As I remember, someone has already mentioned that the font
> instructions for Mac OSX are wrong.
I think that was me, a few weeks ago ;-) and perhaps also
last year ;-)
Then the formulation changed but the new formulation says that
things are automatically set-up for XeTeX on mac os x, which is
wrong.
> I do not have Mac so I cannot try whether it is really necessary
> to copy the fonts, maybe the symlink would be sufficient. And I do
> not know whether the font files must be symlinked, maybe just the
> parent directory may be symlinked. I do not know whether Mac can
> look for fonts into subdirectories.
>
1. I had not tried earlier the symlink approach because the Mac
comes with FontBook app which has a concept of "Font Library"
which one can add to it without having to copy or symlink the
fonts. Also I feared that perhaps I would have to symlink
individually files or many repertories.
The "Font Library" method initially seemed to work but I soon
realized it was a nightmare, because FontBook.app is seriously
broken (at least on Mavericks, but Herb indicates he also has had
bad experiences).
Thus I dropped it some months ago and entered resignation mode.
(Michael Sharpe has some very nice extras to his font packages so
that even when accessing a font by filename with xelatex one does
not have to list explicitely the bold, italic, etc.. variants, but
doing this for all fonts obviously requires extra work)
2. But Herb Schulz gave me very good advice to simply symlink the
texmf-dist/fonts/opentype (and I did also texmf-dist/fonts/truetype)
from $HOME/Library/Fonts. The miracle is :
a. FontBook.app is still usable after that. There is only a
slight delay in opening it, about two seconds during which the font
list is prepared.
b. all fonts in sub-repertories are found nicely
c. there are a few duplicates between .otf and .ttf (FreeSerif,
FreeSans, FreeMono in particular) but the FontBook GUI allows to
choose which fonts to validate and this works with no hiccup.
(which is surprising regarding FontBook.app)
d. there is slight disadvantage that some fonts with names
starting with "drm" occupies many (dozens) lines in FontBook
display, but that's cosmetic.
After my bad experience with the concept of "Font Library" I was
very much surprised that simply putting symlinks worked out so
well. Thanks Herb !
And I could confirm that after that, all the TeXLive distributed
opentype/truetype fonts become generally available to Mac
Applications such as TextEdit, OpenOffice, etc... and to XeTeX
naturally. The delay I mentioned above applies only to FontBook.app,
applications such as OpenOffice have their font popup instantly
available with TeX Gyre Termes etc... and naturally XeTeX works
with no delay either.
3. There is perhaps an impact on LuaTeX+luaotfload, because the
TeXLive distributed fonts will be indexed twice. I do not know if
this slows down LuaTeX. I opened a ticked on github site of
luaotfload about this asking for info.
https://github.com/lualatex/luaotfload/issues/359
4. The specific way to symlink by Herb takes advantage of the
TeXDist structure which has been part of MacTeX install for some
years, in /Library/TeX. This way the symlinks are dynamical and
obey on the fly change of TeXLive distribution year.
ln -s /Library/TeX/Root/texmf-dist/fonts/opentype
~/Library/Fonts/TeXOpenType
I did also
ln -s /Library/TeX/Root/texmf-dist/fonts/truetype
~/Library/Fonts/TeXTrueType
but had to resolve a few duplicates then as mentioned above.
(the point is that /Library/TeX/Root is already itself a symlink,
and when changing distribution year via the former Panel or via
TLU, its target is automatically updated)
5. To make my story complete: took me a while to go to the root
of the following problem. I was surprised to see that log files
with \XeTeXtracingfonts1 indicated the opentype fonts were picked
always from texlive/2015, even if working with TL2014 or TL2016
pretest.
Turns out that my earlier attempt at adding TeXLive OpenType fonts
to general mac os availability via a "Font Library" added to FontBook.app
had resulted in some non-removed cache in /private/var/folders.
I looked
in vain everywhere in my $HOME and in obvious system locations,
for such a file, as it was obviously the only explanation to the
observed behavior and was finally saved by the tip at
http://osxdaily.com/2015/01/08/clear-font-caches-databases-mac-os-x/
which is to do $ sudo atsutil databases -remove
it is important to reboot immediately after that.
This last item is only of relevance to people who messed up with
FontBook.app before, I guess.
To sum up: For smooth experience with XeTeX on Mac OS X, some
people (me following Herb) have found that
ln -s /Library/TeX/Root/texmf-dist/fonts/opentype ~/Library/Fonts/TeXOpenType
and
ln -s /Library/TeX/Root/texmf-dist/fonts/truetype ~/Library/Fonts/TeXTrueType
is a well-working approach. In some rare cases, it might be needed to do
(before or after it does not matter)
sudo atsutil databases -remove
and
to reboot. That's only to clean-up a pre-existing dysfunctional font situation.
Hope it helps.
Jean-François
More information about the tex-live
mailing list