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

Fontspec fontname lookup issues with XeTeX and type1 fonts (e.g., picks bolditalic for italic, semibold for bolditalic, etc.) #419

Closed
2 of 4 tasks
callegar opened this issue Mar 22, 2020 · 2 comments

Comments

@callegar
Copy link

Description

Fontspec + XeTex seems to select wrong font variants, when fonts are specified by name and postscript fonts are around.

Consider the example below, a minimal test file using the Libertinus font. The source does always work right with lualatex. However, with xelatex, if the type1 version of Libertinus is around (Texlive package libertinus-type1), then bolditalic is incorrectly chosen in place of italic and semibold is incorrectly chosen in place of bolditalic.

To better illustrate my setup, I have an ubuntu (in fact kubuntu) 19.10 machine, where I use the pristine texlive 2019 (not the texlive provided via deb files in the distro). My texlive has constantly been updated until texlive 2019 updates were halted to develop texlive 2020. I am exposing all the opentype, truetype and type1 texlive font dirs to the system, by a fontconfig configuration file, as suggested in the texlive installation instructions.

In this situation, the system sees both the opentype and the type1 versions of libertinus (because I have both the libertinus-otf and libertinus-type1 tex packages, and xetex picks wrong fonts.

If I hide the type1 fonts from the system, then xetex picks the right font. If I hide the opentype fonts, so that xetex can only see the type1 fonts, then xetex picks the wrong font. Hence the issue does not seem to be related to the fact that both versions of the font exist, rather it seems specific to type1.

It is unclear to me if the issue is related to fontspec or to xetex itself.

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}
\setmainfont{Libertinus Serif}
\begin{document}
Test \emph{test} \textit{test} \textbf{test} \textbf{\textit{test}}.
\end{document}

Further details

I am also adding a log file, obtained with the tracing of fonts (\XeTeXtracingfonts 1).
test.log

Note that fc match always returns the right fonts on the system. For instance, with only type 1 I get:

fc-match -f "%{file}\n" "Libertinus Serif:style=italic"
/usr/local/texlive/2019/texmf-dist/fonts/type1/public/libertinus-type1/LibertinusSerif-Italic.pfb
@wspr
Copy link
Collaborator

wspr commented Mar 23, 2020

I'm sorry to have to close this after the detail you've included but fontspec does not have anything to do with font lookup, it just uses whatever the engine provides.

@wspr wspr closed this as completed Mar 23, 2020
@callegar
Copy link
Author

Nothing to be sorry. If I am correct it only means that I need to redirect this to the xetex issue tracker, right? This is already a quite useful piece of info!

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