Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Jost*" font (with asterisk in font name), error: '"JostJost*" cannot be found' #437

Open
2 of 3 tasks
korakinos opened this issue Dec 23, 2020 · 2 comments
Open
2 of 3 tasks

Comments

@korakinos
Copy link

Description

Trying to compile a LaTeX document using the typeface "Jost*" (with an asterisk in the name) fails with:

tex: Invalid filename `JostJost*/OT:script=latn;language=dflt;', contains '*'



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

Discussion on the XeTeX mailing list arrived at the suggestion that this could be a bug in fontspec. (Probably not one in latex2e.) This bug report is mostly a summary of what has been discussed on the mailing list so far.

Check/indicate

  • Relevant for XeTeX
    [ ? ] Relevant for LuaTeX
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{fontspec}
\setsansfont{Jost*}
\begin{document}
\LARGE
\sffamily this is an example \textit{italics}, \textbf{bold},
and \textbf{\textit{bold italics}}.

\end{document}

Further details

  • To get the fonts for testing: The free version of the Jost* fonts can be downloaded by selecting to pay zero dollars on the download page.

  • The fonts can be referred by file name without issue:

\documentclass{article}
\usepackage{fontspec}
\setsansfont{Jost-500-Medium.otf}[
 BoldFont = Jost-700-Bold.otf ,
 ItalicFont = Jost-500-MediumItalic.otf,
 BoldItalicFont = Jost-700-BoldItalic.otf]

\begin{document}
\LARGE
\sffamily this is an example \textit{italics}, \textbf{bold},
and \textbf{\textit{bold italics}}.

\end{document}
  • xetex (not xelatex) does not have this problem. There the Jost* typefacwe can accessed by family name, not only file name.

  • As a workaround, the asterisk can be deleted from the fonts' family name, e.g. using a short fontforge script:

import fontforge
import sys

for fontname in sys.argv[1:]:
    font = fontforge.open(fontname)
    font.familyname = "Jost"
    font.generate(fontname+"-starless.otf")

After installing the newly created "starless" fonts and referring to them by "Jost" (without asterisk) from LaTeX, the test file is compiled correctly and without issue.

@wspr
Copy link
Collaborator

wspr commented Jan 14, 2022

fontspec uses * as a way to abbreviate font names. I didn't think anyone would define a font name using it. I'll keep this open to consider adding a "NoStar" feature to disable that behaviour.

@wspr
Copy link
Collaborator

wspr commented May 7, 2024

I've tried to fix this and unless I'm missing something obvious I think LaTeX itself is also struggling with the star in the name of the font. I won't close this yet but I don't think this is a simple one. For anyone reading, suggest loading the font by filename instead!

wspr added a commit that referenced this issue May 7, 2024
trying to address #437 but this only fixes the issue on the fontspec side; suspect NFSS itself is tripping up next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants