• Fontname with a slash using XeLaTeX/fontspec

    From Peter Flynn@21:1/5 to All on Fri Feb 16 16:39:46 2024
    I'm interested in using the AnkaCoder font. I downloaded it, but the
    fontname (in the TTF files) is "Anka/Coder" with an embedded slash.

    \documentclass{article}
    \usepackage{fontspec}
    \setmonofont{Anka/Coder Narrow}
    \begin{document}
    text
    \begin{verbatim}
    stuff
    \end{verbatim}
    \end{document}

    This gives the error:

    kpathsea:make_tex: Invalid filename `Anka/Coder Narrow', contains ' '
    ! Package fontspec Error: The font "Anka/Coder Narrow" cannot be found.

    But it seems to be the slash that causes the problem, not the space,
    because trying to load regular Anker/Coder goes off to run METAFONT
    because it thinks the fonts are missing.

    Running fc-list gives (I have pruned /home/peter/texmf/fonts/truetype/google/anka from the start of the
    location for brevity here):

    /AnkaCoder-C75-b.ttf: Anka/Coder Narrow:style=Bold
    /AnkaCoder-C75-bi.ttf: Anka/Coder Narrow:style=Bold Italic /AnkaCoder-C75-i.ttf: Anka/Coder Narrow:style=Italic
    /AnkaCoder-C75-r.ttf: Anka/Coder Narrow:style=Regular
    /AnkaCoder-C87-b.ttf: Anka/Coder Condensed:style=Bold
    /AnkaCoder-C87-bi.ttf: Anka/Coder Condensed:style=Bold Italic /AnkaCoder-C87-i.ttf: Anka/Coder Condensed:style=Italic
    /AnkaCoder-C87-r.ttf: Anka/Coder Condensed:style=Regular
    /AnkaCoder-b.ttf: Anka/Coder:style=Bold
    /AnkaCoder-bi.ttf: Anka/Coder:style=Bold Italic
    /AnkaCoder-i.ttf: Anka/Coder:style=Italic
    /AnkaCoder-r.ttf: Anka/Coder:style=Regular

    Is there a way to allow fontspec to load a font whose name contains an
    embedded slash?

    Peter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich D i e z@21:1/5 to Peter Flynn on Sun Feb 25 01:58:39 2024
    Peter Flynn schrieb:

    Is there a way to allow fontspec to load a font whose name contains an embedded slash?

    On my system, TeX Live 2020 on Debian Buster, copying AnkaCoder-C75-r.ttf to the directory where the .tex-file to compile is stored and saying

    \setmonofont{AnkaCoder-C75-r.ttf}

    works out both with lualatex and xelatex.

    On my system, TeX Live 2020 on Debian Buster, after moving the .ttf-files to '/usr/share/fonts/truetype/AnkaCoder'
    and running
    sudo luaotfload-tool -vvv --update --force
    and
    sudo mktexlsr

    , compiling

    \documentclass{article}
    \usepackage{fontspec}
    \setmonofont{AnkaCoder-C75-r} %\setmonofont{AnkaCoder-C75-r.ttf}[Path=/usr/share/fonts/truetype/AnkaCoder/] \begin{document}
    text
    \begin{verbatim}
    stuff
    \end{verbatim}
    \end{document}

    works out using xelatex for compiling but fails when using lualatex for compiling.

    With lualatex I don't get any error messages from the package fontspec.
    But at the end of the lualatex-run I get the message:

    ! error: (file ) (type 2): cannot find file ''
    ! ==> Fatal error occurred, no output PDF file produced!

    All this is what in fontspec is called "loading by filename".

    Loading by fontname doesn't work out at all both with lualatex and xelatex.

    I don't know whether this might be a bug in fontspec or in luatex
    or whatever.

    But the system where I tested these things is rather old.

    Sincerely

    Ulrich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Flynn@21:1/5 to Ulrich D i e z on Wed Feb 28 10:49:58 2024
    On 25/02/2024 00:58, Ulrich D i e z wrote:
    Peter Flynn schrieb:

    Is there a way to allow fontspec to load a font whose name contains an embedded slash?

    On my system, TeX Live 2020 on Debian Buster, copying AnkaCoder-C75-r.ttf to the directory where the .tex-file to compile is stored and saying

    \setmonofont{AnkaCoder-C75-r.ttf}

    Thanks very much. I'll mark it as an exception.

    Peter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)