adobe-type-tools / afdko

Adobe Font Development Kit for OpenType
https://adobe-type-tools.github.io/afdko/
Other
1.04k stars 169 forks source link

Otfautohint question: how to correctly autohint Cascadia Code Italic's `d`? #1682

Open madig opened 3 years ago

madig commented 3 years ago
  1. Get https://github.com/microsoft/cascadia-code/releases/tag/v2106.17
  2. Look at otf/static/CascadiaCode-Italic.otf in a renderer
  3. Observe that the d behaves erratically depending on size

The glyphs was autohinted with psautohint. Result:

image

It should instead look like this (note the new hstem or something where the bowl of the d connects to the stem):

image

How to make psautohint do it by itself? The two points are 187 font units apart. Private dictionary:

        <BlueValues value="-20 0 1060 1080 1420 1440 1500 1520"/>
        <OtherBlues value="-480 -460"/>
        <BlueScale value="0.0375"/>
        <BlueShift value="7"/>
        <BlueFuzz value="0"/>
        <StdHW value="200"/>
        <StdVW value="190"/>
        <StemSnapH value="200 210 212 220"/>
        <StemSnapV value="180 190"/>
        <ForceBold value="0"/>
        <LanguageGroup value="0"/>
        <ExpansionFactor value="0.06"/>
        <initialRandomSeed value="0"/>
        <defaultWidthX value="1200"/>
        <nominalWidthX value="107"/>
miguelsousa commented 3 years ago

I think that for psautohint to add the hint at the glyph's waist the control points will need to be more horizontal.

madig commented 3 years ago

@miguelsousa Ok, thanks :thinking:

@aaronbell Do you think you can fudge this somehow?

aaronbell commented 3 years ago

😶 I'm not sure there is a way to fudge this...

madig commented 3 years ago

Hrm. I guess one can run a post-processing script somehow... I'd need to deep-dive into psautohint maybe...

aaronbell commented 3 years ago

Good luck! I guess this is the limitation of autohinting...

madig commented 3 years ago

Josh Hadley says:

It’s been a (long) while since I’ve driven outline design tools, but it seems likely you could put some intermediate points on the curve, which would allow you to bring the BCPs rightward and upward a bit. How much, I do not know, sadly :frowning:

Hm.

aaronbell commented 3 years ago

Well, doing that would inherently change the nature of the curve. I spent a lot of time on that curve. 😛

What might be easiest would be to add a point at the stem join location, then shift the 'connecting' node a point or two to the left. It'll create some horizontal, and be pretty ugly close up, but would be invisible at text sizes after rasterization. But I wouldn't really want to do that in the master...