googlefonts / how-to-hint-variable-fonts

A how-to guide to TrueType hinting variable fonts, with VTT
https://googlefonts.github.io/how-to-hint-variable-fonts
Apache License 2.0
37 stars 4 forks source link

Composite accent positioning with ital axis and autohinted source #21

Closed chrissimpkins closed 2 years ago

chrissimpkins commented 2 years ago

Related README content:

VTT Autohinter generates additional code for composite glyphs, to position accents for smaller font sizes and lower resolutions. The code used in the VTT Version 6.35 can cause problems in Variable fonts. All accented glyphs need to be carefully checked to make sure the the automatic code is correct. The following are some of the problems, and solutions.

Accent Positioning code

In addition to the Offset code, VTT Light Latin autohinter generates code to position accents in the x and y-direction.

X-direction positioning Code

x-direction code should be removed for all accented glyphs. The offset code is sufficient to position accents correctly in the x-direction.

Example: ‘edotaccent’ 0x117 (GID 217) in OpenSans Variable

With the Glyph program window selected, (ctrl + 2), delete the following code.

SVTCA[X]

CALL[], 41, 35, 20, 32, 5, 87

SHC[2], 2

Compile the glyph program, (Tools > Compile > Glyph program, or(ctrl + r) and Save. Repeat this for all accented glphs in the font.

I came across a good example of badly misaligned marks in italic instances if you want to emphasize this point with visuals.

With auto SVTCA[X] source

Screenshot-hinting-x-pre

Following removal of auto SVTCA[X] source

Screenshot-hinting-x-post

I think that I'd call this a bug in the current version of VTT. Is there a benefit to this automated x positioning source? It is pretty onerous to remove it in every composite.

Font for reproduction of the issue: https://github.com/rsms/inter/releases/tag/v3.19

chrissimpkins commented 2 years ago

FWIW I ran the autohinter on the Open Sans Italic build and can't reproduce this issue. It seems to be related to the use of an italic axis in a variable design space.

mikedug commented 2 years ago

yes I consider this a bug, and have communicated it as such to MS. I am not aware of any benefit. I am hopeful this will be fixed soon. Will follow up on it. I will look to include an example, there are plenty of good examples in the OpenSans Roman, which can then be viewed in the Demo font.

mikedug commented 2 years ago

The doc can be updated in the shorter term, if this bug gets addressed, and a new public release made of VTT

mikedug commented 2 years ago

I probably spoke to soon on being optimistic for a fix for this. On looking back, the last correspondence, I had mentioned it as not a high priority. This can certainly be added to the deficiencies list

chrissimpkins commented 2 years ago

I probably spoke to soon on being optimistic for a fix for this. On looking back, the last correspondence, I had mentioned it as not a high priority. This can certainly be added to the deficiencies list

No worries! Thanks Mike

mikedug commented 2 years ago

sorry that was meant to read, it was mentioned as not high priority, I consider it high priority, it is as you mention onerous to remove.

chrissimpkins commented 2 years ago

I understood. Is the glyph assembly dumped as text in the XML export? If so, we should be able to come up with an approach to scrub it out across the full glyph set before a reimport. This could happen at the ResYDist --> YShift transition stage.

mikedug commented 2 years ago

Edited some of the text in the accent positioning section, on x-direction positioning, and added a graphic example from the OpenSansDemoVTT[wdth,wght].ttf. This will allow anyone reading to look at the exact example in the Demo Font.