-
Notifications
You must be signed in to change notification settings - Fork 7
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
luaotfload and Math fonts: cvNN feature for superscripts not applied #266
Comments
@dflipo When you talked to Has Hagen about this, did he mention if he plans to add this change to ConTeXt MKIV soon too? |
This bug seems to remain unresolved. The above fix with the extra fontloader file does NOT work with StylisticSets. NewComputerModern is to provide scriptstyle and scriptscriptstyle glyphs for the alternate calligraphic Latin capitals. Let me call those "mathscr". The default is "mathcal" and StylisticSet=1 replaces mathcal with mathscr. This works fine with xelatex. But with lua only the base of an exponent is changed to mathscr. So if you write \mathcal{A}^{\mathcal{A}} you get the base A in mathscr and the exponent A in mathcal. |
When trying the changed fontloader with NewComputerModern's ss01 it does work for me. |
Hello @zauguin, How does one use the changed fontloader? Without using the fontloader, I provide a MWE: \documentclass[border=1cm]{standalone}
\usepackage{fontspec}
\setmainfont[%
Renderer = {Harfbuzz},%
StylisticSet = {5},%
CharacterVariant = {5},%
Extension = {.otf}%
]{NewCM10-Book}
\begin{document}
x͜y\textsuperscript{x͜y}
\end{document} My system is up-to-date. Can you reproduce this image with the fontloader? |
@zauguin, forgot to mention, for me, the following didn't work:
In my log, I can see this, which means I am using the file, but the output is wrong:
|
@niruvt This is an different issue. The font you are using has different optical sizes for 10pt and 8pt and the 10pt version does not seem to handle the combining character correctly here. |
@zauguin Okay, my bad. |
It's the same as the previous issue: The subscript is smaller and therefore uses a different font. If you only provide a updated NewCM10-Book and not an extended NewCM08-Book you will only affect the bigger one. |
@zauguin yes, I figured it out and hence deleted the comment, thanks for the attention! |
My system did not have the latest updates. After updating and after placing the above fontloader file in t he same directory NewCM produces correct output. So now the question is when will this be released? CTAN has a file with the same name but it is different than the one above. |
This is now merged into the dev branch and will probably be part of the next release. |
This issue is similar to #227.
For the Math fonts I maintain, I use cvNN features to to toggle Greek variants in Maths, f.i. the cv06 feature makes \phi output mitvarphi (U+1D711) instead of mitphi (U+1D719) the default. It works fine for base characters, but I recently noticed a problem with the superscripts of these variants (bolder glyphs mitvarphi.st and mitvarphi.sst are available for the ssty feature): only one feature is applied by luaotfload, actually the last called by the font (not the first as I wrote previously).
I reported on SE (https://tex.stackexchange.com/questions/698768/) and after private exchanges with with Mikael Sundquist and Hans Hagen, they came up with a solution (thanks to both of them!) which works for me (see the appended "fontloader-2023-08-19.lua" file).
The following MWE: requires XCharter-Math v0.51 pushed to CTAN today. In this new version, feature ssty is applied last (it was applied before all cvNN features in previous versions). Screen captures of the compilation by current LuaLaTeX, XeLaTeX (correct output) and LuaLaTeX+patch (correct output) are appended.
`\documentclass{article}
\usepackage{unicode-math}
\usepackage{iftex}
\begin{document}
\setmathfont{XCharter-Math.otf}
\ifluatex LuaLaTeX: \fi
\ifxetex XeLaTeX: \fi
\vspace{.5\baselineskip}
(\phi^{\phi^{\phi}}, v^{v^{v}})
\setmathfont{XCharter-Math.otf}[CharacterVariant={6,11}]
(\phi^{\phi^{\phi}}, v^{v^{v}})
\end{document}`
Outputs (screen captures):
After adding file "fontloader-2023-08-19.lua" to the current directory, the output is correct:
fontloader-2023-08-19.lua.zip
The text was updated successfully, but these errors were encountered: