The example from font-sel.mkvi fails to load system fonts:
\definefontfamily [dejavu] [serif] [DejaVu Serif]
\definefontfamily [dejavu] [sans] [DejaVu Sans]
\definefontfamily [dejavu] [mono] [DejaVu Sans Mono]
\definefontfamily [dejavu] [math] [XITS Math] [scale=1.1]
\setupbodyfont[dejavu]
\starttext
\input knuth
\stoptext
With these errors:
...
selectfont > The requested font 'DejaVu Serif' has no files for the 'tf' alternative, Latin Modern is used instead.
selectfont > The requested font 'DejaVu Sans' has no files for the 'tf' alternative, Latin Modern is used instead.
selectfont > The requested font 'DejaVu Sans Mono' has no files for the 'tf' alternative, Latin Modern is used instead.
...
mkiv lua stats > loaded fonts: 2 files: lmroman10-regular.otf, xits-math.otf
mkiv lua stats > font engine: otf 3.029, afm 1.512, tfm 1.000, 4 instances, load time 1.252 seconds
...
Same errors for any other system fonts. So what to do?
Try running luaotfload-tool? It takes a while to create the database, but is able to access all system fonts:
$ luaotfload-tool --find='MuseJazz' -F
luaotfload | resolve : Font "MuseJazz" found!
luaotfload | resolve : Resolved file name "/usr/share/fonts/mscore/MuseJazz.ttf"
And just for good measure, again:
luaotfload-tool --update
Unfortunately, still no luck in loading the fonts:
export OSFONTDIR="/usr/share/fonts;$HOME/.local/share/fonts;/usr/local/share/fonts;$HOME/.fonts"
context test
Then I try:
context --generate
This runs, but claims to do nothing. I think because it is for single-user installations and it lacks write access to the /usr/share/tex* directories. Instead I have to run this:
mtxrun --generate
This writes to ~/.texlive2017/ but I still can't run the commands the wiki says I'm supposed to run next:
$ mtxrun --script fonts generate
mtxrun | unknown script 'fonts.lua' or 'mtx-fonts.lua'
$ mtxrun --script fonts --list --all --pattern='*'
mtxrun | unknown script 'fonts.lua' or 'mtx-fonts.lua'
OK, lets run anything that has a --generate option:
$ luatools --generate
mtxrun | unknown script 'base.lua' or 'mtx-base.lua'
Nope... OK, let's switch to the root user.
$ kpsewhich texmf.cnf
/usr/share/texlive/texmf-dist/web2c/texmf.cnf
First edit texmf.cnf to replace OSFONTDIR with the value from above. Update the luaotfload-tool database as per above. Let's see if mtxrun knows about the fonts script... No. First run context --generate then mtxrun --generate. Now there is some apparent success because I can run mtxrun --script fonts generate. Unfortunately it appears the generated font database is ignorant of system fonts:
$ mtxrun --script fonts --list --all --pattern='*' | egrep -i muse | wc -l
0
Even though mtxrun --generate only modified the global /usr/share/texlive/texmf-var/ location rather than /root/*, the changes are only accessible to the root user. After switching back to the main user, I still can't run this:
$ mtxrun --script fonts generate
mtxrun | unknown script 'fonts.lua' or 'mtx-fonts.lua'
I'm not sure what to try next.
[*] Texlive on Fedora seems to be a mix of dates and svn revisions:
- texlive.noarch 6:2016-52.20160520.fc28
- texlive-base.x86_64 7:20170520-41.fc28
- texlive-collection-context.noarch 6:svn36190.0-52.20160520.fc28
- texlive-collection-luatex.noarch 6:svn39902-52.20160520.fc28
- texlive-context.noarch 7:20170520-41.fc28
- texlive-luatex.x86_64 7:20170520-41.fc28
- texlive-context-title.noarch 6:svn36189.0-52.fc28.2
mtxrun --script fonts --reload. – Wolfgang Schuster Nov 15 '18 at 18:34tex/texmf/fonts/opentype/public/xits/XITSMath-Regular.otfbut how do I know which family name so that\definefontfamilycan load it? – user19087 Nov 16 '18 at 01:19