Copy TT hints from one master to another (or all)?

I’m wondering if there is a way (through scripting, I’m guessing) to copy manual TT hints from one master to another, or to all other masters.

if you have a the masters in one file, you don’t need to do anything, just hint the first master and the other masters will inherit the hints.

If you have them in different files, you can access the hints from a script. You just need to make sure that the originNode and targetNode property is set properly. I just saw that the hint object is not covered in the documentation, I will fix that asap and provide some sample scripts.

Oh! Awesome. Which master is considered the “first master”?

Also, what happens to hints added to other masters?

The upmost in the list in Master settings, or the one you get when pressing cmd+1. I was not entirely true, actually should be able to hint one of the other layers as long as you have no hints in the first layer.

they should be ignored

But what happens if something needs a different hint in one master? For example, what if the crossbar of A needs to be rounded down in heavy weights but not light weights?

This is a good question. Just adding another hint in one master would lead to quite difficult to solve incompatibilities.

It seems like the best way to handle this would be bracket layers or alternate forms that get renamed on export—assuming that hinting occurs before stuff gets swapped around.

I hinted a true-type font as described above in Glyphs 2.6.5 (1342).
Hinted the first layer and left the other one untouched.

The TrueType preview of the second layer inside Glyphs looks fine.
Links, stems and deltas seem to do their work.

If I export the font to TT or generate instances, only the fist layer appears to have hints.
Am I missing something? Do I have to activate the hints somewhere?

They are compatible?

Hey Rainer,
thanks for the fast response.
The PS curves where compatible, therefore the on-curve-points are too.
The off-curvee-points are most likely not. Do they have to be?

Since the preview inside Glyphs works, I assumed this might be enough.
(I’m used to copying TT-hints through the PS-mask (FL5) as presented by Frank Grießhammer at Robothon)

So I was hoping, you might have something similar working under the hood.

Can you send me a file with just that glyph?

1 Like

I had a look at the file. The masters of the glyph are not compatible.

  1. You do not need to convert to TT curves manually. You can attach the TT hints to the PS curves. It is probably better to leave the PS curves as they are, and let the TT conversion happen automatically after interpolation.
  2. If you do convert to TT curves, they must be compatible, including off-curves.
  3. Font Info > Font > Custom Parameters > Enforce Compatibility Check helps with ensuring compatibility even when there are no intermediate instances.
  4. If masters are compatible, you only hint the first master. Hints in other masters are ignored. (This applies to both TT and PS hints.)

I could get it to work as expected by converting the curves to PS, tidying up paths, and inserting a few instances in between with the mekkablue script Interpolation > Insert Instances.

Hi Rainer,
Thanks a lot for enlightening me on this.

Is this documented elsewhere?
Because I was looking for additional information on TrueType hinting with Glyphs, in the manuals, the forum, youtube and gitbub and could not find it.
Wish I would have known earlier.
Next time I’ll know :slight_smile:

Said that, I like the approach!

There is a chapter in the handbook, and a tutorial is coming up.

And the latest additions (mostly custom parameters) are spread out over the blog posts.