latex3 / fontspec

Font selection in LaTeX for XeTeX and LuaTeX
http://latex3.github.io/fontspec/
LaTeX Project Public License v1.3c
277 stars 34 forks source link

FakeBold in lualatex not allowing values below 1.5 ? #498

Closed ghost closed 8 months ago

ghost commented 8 months ago

Description

FakeBold=1.05 produces same result as FakeBold=1.5 in lualatex. Unexpected. This was noticed by another user at https://tex.stackexchange.com/questions/708507/want-to-darken-a-font-just-a-little

Check/indicate

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Latin Modern Roman}
\begin{document}
hello\par
{\addfontfeature{FakeBold=1.05}hello}\par
{\addfontfeatuyre{FakeBold=1.5}hello}\par
\end{document}

Further details

The second hello should be just slightly darker than the first. But actually, it is darkened more, to match the third. Does not matter which font (only used LMR for MWE). I do not recall this behavior in the past.

khaledhosny commented 8 months ago

A generated PDF from this example (there is a typo in the 2nd addfontfeature) shows slight difference in darkening between the 2nd and 3rd lines, amd the generated PDF has:

0.105 w
2 Tr
/F27 9.96264 Tf
1 0 0 1 148.712 695.17 Tm [<003F0032004800480051>]TJ
0.150 w
2 Tr
/F27 9.96264 Tf
1 0 0 1 148.712 683.215 Tm [<003F0032004800480051>]TJ

Notice the 0.105 w and 0.150 w, so the PDF has the correct values. Since the emboldening (actually stroking) is actually done by the PDF renderer, I don’t see a fontspec or even engine issue here, they are simply setting a value in the PDF file.

wspr commented 8 months ago

This seems definitive (thanks again) that there's nothing else for fontspec specifically to do here.

ghost commented 8 months ago

Thanks for looking into that. Reminds me: In PDF the decorations around hyperlinks are usually provided by the reader software.