-
Notifications
You must be signed in to change notification settings - Fork 34
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
strange size selection for italic with \setmainfont{Latin Modern Roman} after using \slshape #486
Comments
you get a font warning in the log:
I don't know if fontspec could catch that, but you can avoid it by setting the slantedfont explicitly
|
I've seen the Font Info, but IHMO an automatic font replacement should not change the size of another font, i.e., not if that other font already has been used with the correct size. On TeX.Stackexchange (see the link above) I've also already commented, that either setting ItalicFont or SlantedFont explicitly, fixes the problem. But IMHO this is suboptimal. I would maybe understand, if the SlantedFont would have been in the wrong size. But that selecting slanted breaks the italic font is unexpected not only for me, but IMHO for the average user. |
I don't fully understand what is happening here, but I agree it's not good! |
It looks to me as if the source of the trouble is this NFSS macro
Its long long time ago but the code attempts to reset the display name in something like \showoutput for the the font that was the source of of the of the substitution, if I remember correctly (the docs are somewhat sketchy). If an external font was used with two \font declarations then TeX would always reports the last macro as the font selector and the
you still see Obviously, this seems to fails with fontspec when (as @u-fischer pointed out to me) fonts with optical sizes are involved. |
By the way, the problem is luatex specific, with XeTeX the |
The problem is that with fonts with optical sizes \fontname\font doesn't give back the size:
types out
and the "reused" font are smaller for latin modern: Imho that is something that should be handled by luaotfload. |
Does anyone see an issue with just always adding the size in \fontname and other places by claiming a designsize of 0? |
Well, what is important is basically a way to be able feed in the result of
Now I would be possible to do this on the macro level (given that we know the
but that would badly fail if the font does already has some So it would be much better if \fontname really contains what it should, which is data that allows for the roundtrip. pdfTeX and XeTeX do while luatex doesn't. Not sure if this is a bug in the primitive or if there is no primitive in luaTeX and the data is produced by luaotfload ... in either case I think it should be correct at the engine/luaotfload side. If pretending a design size of 0 does the trick I don't know. |
I now implemented the "design size 0" approach in luaotfload's dev branch, so far it looks like it's working. |
sounds good @zauguin! much better if this works out of the box rather than having to analyze the return value of |
@zauguin this just came up again in the tex.sx change. Imho it would be good to make a luaotfload update. |
When a LuaLaTeX document with base font size 12pt and
\setmainfont{Latin Modern Roman}
switches to\slshape
and than switches to\itshape
the italic text is printed smaller.Results in:
As you can see, the fourth line is printed smaller than the second, which should not happen.
See also https://tex.stackexchange.com/q/689449/277964 where the issue has been reported first.
The text was updated successfully, but these errors were encountered: