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_check_script:Nn fails in some cases #530

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Udi-Fogiel
Copy link

@Udi-Fogiel Udi-Fogiel commented Sep 6, 2024

Status

READY

Description

If for some reason \curr@fontshape is not the really the shape of the currently selected font,
e.g. due to a missing shape, and LuaTeX is the used engine,
the expansion of '\curr@fontshape/\f@size' is not
the name of the font switch that needs to be checked. Example:

It would be more reliable to use \the\font to get
the name of the switch of the currently selected font.

Todos

  • Tests added to cover new/fixed functionality
  • Documentation if necessary
  • Code follows expl3 style guidelines

Minimal example demonstrating the new/fixed functionality

\documentclass{article}
\usepackage{fontspec}
\setmainfont{David CLM}
\begin{document}
\scshape % comment this line to see the effect
\ExplSyntaxOn
\fontspec_if_script:nTF{hebr}{yes}{no}
\end{document}

Note how this example returns true with LuaTeX but false with XeTeX.

If for some reason \curr@fontshape is not the really
the shape of the currently selected font, e.g. due
to a missing shape, and LuaTeX is the used engine,
the expansion of '\curr@fontshape/\f@size' is not
the name of the font switch that needs to be checked.
Example:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{David CLM}
\begin{document}
\scshape % comment this line to see the effect
\ExplSyntaxOn
\fontspec_if_script:nTF{hebr}{yes}{no}
\end{document}

Note how this example returns true with LuaTeX but
false with XeTeX.

It would be more reliable to use \the\font to get
the name of the switch of the currently selected font.
Udi-Fogiel referenced this pull request in reutenauer/polyglossia Sep 6, 2024
This could happen if a shape is not found and substituted
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

Successfully merging this pull request may close these issues.

1 participant