Skip to content

Conversation

@zauguin
Copy link
Member

@zauguin zauguin commented Sep 20, 2018

Adds nospaces if it does not exist yet. This allows the names database to be built again.

@u-fischer
Copy link
Member

Thanks. That was a very useful information. We will update lualibs together with luaotfload so the patch will not be needed.

@u-fischer u-fischer closed this Sep 25, 2018
@zauguin zauguin deleted the dev-2.9 branch February 27, 2019 12:53
gucci-on-fleek added a commit to gucci-on-fleek/luaotfload that referenced this pull request Nov 21, 2025
With "tfmdata.mode = 2" (PDF stroke and fill), if you set
"tfmdata.width" to a non-zero integer, then the glyphs are stroked with
a line of that thickness; this is documented in the LuaTeX manual. If
you set "tfmdata.width" to zero, then the stroke width will be inherited
from the environment; this isn't documented anywhere, but it's somewhat
useful, and someone is probably relying on it. If you set
"tfmdata.width" to a non-zero value that rounds to zero, then you get
the same behaviour as if you set it to exactly zero; this is somewhat
surprising, since it means that in most cases, "tfmdata.width = 0.49"
produces much thicker glyphs than "tfmdata.width = 0.51". Example:

     \input{luaotfload.sty}

     \font\TestFontA={lmroman10-regular:embolden=0.000;} at 10.0pt
     \font\TestFontB={lmroman10-regular:embolden=0.006;} at 10.0pt
     \font\TestFontC={lmroman10-regular:embolden=0.005;} at 10.0pt

     \def\Test#1{%
     \par
     {\tt\string#1}:
     \pdfextension literal {10       w} latex3#1 ooo
     \pdfextension literal { 1       w} latex3#1 ooo
     \pdfextension literal { 0.00001 w} latex3#1 ooo
     }

     \nopagenumbers
     \Test\TestFontA (Expected)
     \Test\TestFontB (Expected)
     \Test\TestFontC (Weird!)
     \bye

The LuaTeX engine developers aren't planning on fixing this

     https://mailman.ntg.nl/archives/list/dev-luatex@ntg.nl/thread/7BRXFIAOVQDHMBZADBREXOV6YECYFHS3/

and this current behaviour is incompatible with XeLaTeX

     https://tex.stackexchange.com/q/755049

so this commit modifies the "embolden" manipulator to check if the
computed stroke width is non-zero but would round to zero; if so, it
sets the stroke width to 1 instead. This ensures that the stroke width
will be inherited from an outer PDF group if and only if the embolden
factor is exactly zero.

An alternative (and simpler) solution would be to use "math.ceil" to
unconditionally rounds up the computed embolden width; this could
potentially cause backwards compatibility issues since this means that
half of all embolden values would now be 0.001pt thicker than before.
However, since this is applied only by the PDF renderer, this would not
affect line breaking.
gucci-on-fleek added a commit to gucci-on-fleek/luaotfload that referenced this pull request Nov 21, 2025
With "tfmdata.mode = 2" (PDF stroke and fill), if you set
"tfmdata.width" to a non-zero integer, then the glyphs are stroked with
a line of that thickness; this is documented in the LuaTeX manual. If
you set "tfmdata.width" to zero, then the stroke width will be inherited
from the environment; this isn't documented anywhere, but it's somewhat
useful, and someone is probably relying on it. If you set
"tfmdata.width" to a non-zero value that rounds to zero, then you get
the same behaviour as if you set it to exactly zero; this is somewhat
surprising, since it means that in most cases, "tfmdata.width = 0.49"
produces much thicker glyphs than "tfmdata.width = 0.51". Example:

     \input{luaotfload.sty}

     \font\TestFontA={lmroman10-regular:embolden=0.000;} at 10.0pt
     \font\TestFontB={lmroman10-regular:embolden=0.006;} at 10.0pt
     \font\TestFontC={lmroman10-regular:embolden=0.005;} at 10.0pt

     \def\Test#1{%
          \par
          {\tt\string#1}:
          \pdfextension literal {10       w} latex3#1 ooo
          \pdfextension literal { 1       w} latex3#1 ooo
          \pdfextension literal { 0.00001 w} latex3#1 ooo
     }

     \nopagenumbers
     \Test\TestFontA (Expected)
     \Test\TestFontB (Expected)
     \Test\TestFontC (Weird!)
     \bye

The LuaTeX engine developers aren't planning on fixing this

     https://mailman.ntg.nl/archives/list/dev-luatex@ntg.nl/thread/7BRXFIAOVQDHMBZADBREXOV6YECYFHS3/

and this current behaviour is incompatible with XeLaTeX

     https://tex.stackexchange.com/q/755049

so this commit modifies the "embolden" manipulator to check if the
computed stroke width is non-zero but would round to zero; if so, it
sets the stroke width to 1 instead. This ensures that the stroke width
will be inherited from an outer PDF group if and only if the embolden
factor is exactly zero.

An alternative (and simpler) solution would be to use "math.ceil" to
unconditionally rounds up the computed embolden width; this could
potentially cause backwards compatibility issues since this means that
half of all embolden values would now be 0.001pt thicker than before.
However, since this is applied only by the PDF renderer, this would not
affect line breaking.
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.

2 participants