How to get values from Dimensions palette via scripting

Is this possible?

First get the dimension dictionary:

masterID = Font.masters[0].id
Dimensions = Font.userData["GSDimensionPlugin.Dimensions"][masterID]

here is a list of all valid keys

HV
HH
OV
OH
nV
nd
oV
oH
tH
arAlef
arBar
arRoundThin
arRoundThick
thaiHBall
thaiVBall
thaiHStem
thaiVStem
thaiHRound
BurmeseThin
BurmeseHRound
BurmeseVRound
BurmeseVStem
BurmeseHStem
2 Likes

Good to see Thai and Burmese here! Didn’t we do Lao too though? Instead of Ball, call the Thai thingies Loops.

Are there more by now? Just curious.

HV
HH
OV
OH
nV
nd
oV
oH
tH
arAlef
arBar
arRoundThin
arRoundThick
thaiHBall
thaiVBall
thaiHStem
thaiVStem
thaiHRound
laoHBall
laoVBall
laoHStem
laoVStem
laoHRound
BurmeseThin
BurmeseHRound
BurmeseVRound
BurmeseVStem
BurmeseHStem
cyDeVthin
cyHook
cydeVthin
cydeH
cyhook

Some of the Cyrillic entries are shared with the latin.

1 Like

Hi Georg,
could you show me by example how to access those different values? I cant figure it out.

Thanks.

Here is sample code:

Font = Glyphs.fonts[0]
print "Font: %s\n" % Font.familyName
for thisMaster in Font.masters:
	print "Master: %s\n" % thisMaster.name
	masterID = thisMaster.id
	Dimensions = Font.userData["GSDimensionPlugin.Dimensions"][masterID]
	if Dimensions:
		for key in Dimensions:
			print "   %s: %i" % (key, int(Dimensions[key]))
	print
1 Like