[luatex] Protrude substituted hyphen

Marcel Korpel marcel.korpel at gmail.com
Thu Dec 14 10:28:23 CET 2023


Hi,

In order to use Hoefler Text, which comes with macOS, I need to
substitute the hyphen character, which is by default too high, with
another one contained in the font. (I know that that version of
Hoefler Text is very buggy, but I'm trying to work around several
bugs, and so far I'm happy with the result.)

To substitute the character, I use the following code:

\directlua{
    fonts.handlers.otf.addfeature{
        name = "hyphen",
        type = "substitution",
        data = {
            ["hyphen.standard"] = "hyphen"
        }
    }
}

I also want to protrude several character in the right margin. For this, I use:

\protrudechars=2
\def\setprotcoderm#1{
    \rpcode#1 "002C    215 % ,
    \rpcode#1 "002D    200 % -
    \rpcode#1 "002E    225 % .
}
\font\bodyfont="Hoefler Text:+hyphen" at 11pt
\setprotcoderm\bodyfont

Now the comma and period appear a bit in the right margin, but the
hyphen character does not: only when I cancel the substitution the
above code works as expected (but with the wrong character, of
course).

How do I protrude that substituted hyphen?

Attached are an MWE and two screenshots of macOS's Font Book with both
hyphens, in case that helps.

Thanks in advance!
Marcel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hyphentest.tex
Type: application/octet-stream
Size: 1735 bytes
Desc: not available
URL: <https://tug.org/pipermail/luatex/attachments/20231214/7b3b280f/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hyphen.standard.png
Type: image/png
Size: 81548 bytes
Desc: not available
URL: <https://tug.org/pipermail/luatex/attachments/20231214/7b3b280f/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hyphen.png
Type: image/png
Size: 77103 bytes
Desc: not available
URL: <https://tug.org/pipermail/luatex/attachments/20231214/7b3b280f/attachment-0003.png>


More information about the luatex mailing list.