0

I'm trying to switch from pdflatex to xelatex in wsl and have not yet found a way to fix the font lookup problem.

kpathsea: Running mktextfm P22Virgi
/usr/share/texlive/texmf-dist/web2c/mktexnam: Could not map source abbreviation P for P22Virgi.
/usr/share/texlive/texmf-dist/web2c/mktexnam: Need to update /usr/share/texlive/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input P22Virgi
This is METAFONT, Version 2.7182818 (TeX Live 2019/Debian) (preloaded base=mf)

kpathsea: Running mktexmf P22Virgi ! I can't find file `P22Virgi'. <*> ...ljfour; mag:=1; nonstopmode; input P22Virgi

Please type another input file name ! Emergency stop. <*> ...ljfour; mag:=1; nonstopmode; input P22Virgi

Transcript written on mfput.log. grep: P22Virgi.log: No such file or directory mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input P22Virgi' failed to make P22Virgi.tfm. kpathsea: Appending font creation commands to missfont.log.

! Package fontspec Error: The font "P22Virgi" cannot be found.

For immediate help type H <return>. ...

l.7

? H

A font might not be found for many reasons. Check the spelling, where the font is installed etc. etc.

When in doubt, ask someone for help!

?

With:

hsmyers@BigIron:~/c-dev/tex/tab$ cat ~/.config/fontconfig/fonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <dir>/mnt/c/Windows/Fonts/</dir>
</fontconfig>
hsmyers@BigIron:~/c-dev/tex/tab$

and after fc-cache:

hsmyers@BigIron:~/c-dev/tex/tab$ ll /mnt/c/Windows/Fonts/P22Vir*
-rwxrwxrwx 1 hsmyers hsmyers  88643 Feb 24  2005 /mnt/c/Windows/Fonts/P22Virgi.PFB*
-rwxrwxrwx 1 hsmyers hsmyers   1137 Feb 24  2005 /mnt/c/Windows/Fonts/P22Virgi.pfm*
-rwxrwxrwx 1 hsmyers hsmyers 144120 Feb 24  2005 /mnt/c/Windows/Fonts/P22Virgi.ttf*
hsmyers@BigIron:~/c-dev/tex/tab$ 

on a minimal example file 'test.tex':

\documentclass{article}
\usepackage{fontspec,lipsum}

\defaultfontfeatures{Ligatures=TeX} % \setromanfont{/mnt/c/Windows/Fonts/P22Virgi.ttf}% \setromanfont{P22Virgi}%

\begin{document} \end{document}

Note that the full path (despite the font.conf effort) was tried and failed. A 'Path = ' version failed as well. I've used xelatex in windows, but this is the first attempt under wsl(Ubuntu). I've installed texlive and have had no problems with pdflatex, but prefer the font friendly xelatex hence this attempt.

hsmyers
  • 1,507
  • Maybe you can manually set the environment variables, as mentioned here: https://tex.stackexchange.com/questions/224867/fontspec-not-searching-in-texinputs – Alan Xiang Nov 13 '20 at 05:46
  • I will try that. I've already debugged (partial) with 'export FC_DEBUG=1024 to check if my personal font.conf is used and it is. – hsmyers Nov 13 '20 at 16:38
  • No such luck! I've added the exports all without effect. I wonder about the line that says 'mktexnam: Could not map source abbreviation P for P22Virgi.'? – hsmyers Nov 13 '20 at 16:53
  • I've found an answer in question https://tex.stackexchange.com/questions/12565/load-fonts-that-are-in-a-fonts-directory Not elegant but it works. The line change is \setromanfont[Path=/mnt/c/Windows/Fonts/, Scale=1.5]{P22Virgi}% As in the answer from @Alan-Munn. – hsmyers Nov 13 '20 at 17:46

0 Answers0