Bug in API when accessing TT hints?

Hi Glyphs dev team,

I am trying to write a script to detect when vertical TT hints are pointing in the wrong direction:

# find TT hints pointing towards the alignment zones instead of away from them
glyphs=[]
hintsFound=False
for g in Font.glyphs:
	for l in g.layers:
		if l.isMasterLayer or l.isSpecialLayer:
			for h in l.hints:
				hintsFound = True
				if h.horizontal and h.type==TTSTEM: # h.horizontal seems to be true for vertical hints(!)
					for z in l.master.alignmentZones:
					    [...]

As you can see, h.horizontal seems to be the wrong way round, i.e. True for vertical hints (and presumably False for horizontal ones). Is this a bug?

Best
Tamir

Are you using Glyphs 2 or 3?

Works for me as expected. Have you checked the “presumable”.

Thanks, Georg. I’m still using Glyphs 2.
I’m not sure if I understand what you mean by “presumable”

I’ve just checked the return values of the method and it seems to be returning 1 if horizontal and 0 if vertical. The documentation states that the return type is bool.

Given that there is no handbook for Glyphs 3 yet, I am assuming that the Glyphs API documentation also still refers to Glyphs 2.6.6, is that right?
https://docu.glyphsapp.com/#GSHint.horizontal

Also, the documentation states that the return type of GSHint.targetNode is always a GSNode but in many cases the method returns a GSHandle (presumably when it’s an interpolated node).

Am I using the correct documentation?

You said: “and presumably False for horizontal ones”.

I fixed the type in the Glyphs 3 wrapper.

No, the docu.glyphsapp.com is updated. It has nothing to do with the handbook. I’ll fix the documentation with the targetNode type.

Thanks, Georg, that’s good to know. As we’re still on Glyphs 2.x for our production workflow, is there an archive of the API documentation for Glyphs 2? I presume some things will have changed for Glyphs 3.

The old site is here: https://docu.glyphsapp.com/glyphs2/

2 Likes