Documentation is missing

Also, often the list at the top of an object is not aligned with the detailed content that comes afterward. For example GSFont.characterForGlyph().

It’s worth mentioning that there are several TODOs spread around the docs. Would be great to have the missing info accessible.

The Python API exists, this code for example does not raise exceptions:

for glyph in Glyphs.font.glyphs:
	for layer in glyph.layers:
		for guide in layer.guides:
			print(guide.orientation)

Could you add the missing bit in the docs?

We are currently in the process of reworking the entire docs, both Python and Objective-C. I think many issues like these will be handled by that.

If anything comes up in the meantime, feel free to ask and we’ll report on any infos missing.

Both the slant and orientation properties exist and can safely be used.

Thanks Florian!

Can you elaborate a bit on the type of these two attributes?

GSCompoent.slant is a tuple of two angles (slantX, slantY), both values are given in degrees.

The slant is a subset of the affine transformation of the component (GSCompoent.transform).

You can get and set the slant of a component.

Generally, slantY is kept at 0 and only slantX is changed. This allows the slant to be reconstructed cleanly in components that also use rotation.


Orientation is not exposed in the UI as it’s still considered experimental, but for guides that are not exported it should be fine to use right now. There are more infos on the orientation property in this topic:

great, thanks!

Hey Florian! A couple more reports from my side:

  • I’ve found a keepWeight property in the component schema. I cannot find a clear link with the Python API or the app in general. Is it a deprecated attribute? If it’s in use, what does influence?
  • the default value for the alpha attribute of an image is set to 100 in the schema, but the default of a newly initiated GSBackgroundImage obj is 50 (confirmed by the API docs)
  • the GSBackgroundImage documentation is missing the slant attribute

This should be removed.

keepWeight was part of an experimental feature that never shipped, but some files from the trial run of that feature would still carry this attribute, so it’s part of the schema. You can ignore its value as it’s never used.

You are right, that’s a mistake in the schema. There is a limit of 100, but the default is 50. I fixed it.

Any GSTransformable (which are images, but also components, for example) has a slant. This will be part of the reworked API docs.

Thanks for the quick replies! I’ll keep using this thread to report issues as I encounter them.

Hey Florian!

I’ve noticed a “active” property inside the fontMaster definition in the glyphs 3 format schema. I cannot find an API linked to the data. Is it there for compatibility reasons?

Cheers

Can be removed.

1 Like

Hey!

What kind of data is stored in this attr along with node data?

is that accessible through GSNode().attributes? I don’t see documentation for this, but if I run it on GlyphsApp it does not raise an exception.

The attrShape schema can store any data, similar to user data. It also exists on shapes like paths and components.

While it can story anything, it’s certainly worthwhile documenting the keys and values that Glyphs uses. I just have not yet come around to collecting that in the schema definition.

Generally, for nodes there is stuff like the stroke thickness and other stroke related infos, for paths there is fill color and other graphic attributes.

1 Like

thanks Florian!

Can you also help me figure out the iconName attribute of a GSFontMaster?

There isn’t much here:

Is it related to the button in the UI top bar to access the masters?

Also if I try to print the attribute from one of our fonts I get this

which is, to be honest, unexpected :sweat_smile:

Cheers,
R

I would assume that refers to the icon you can set in Font Info > Masters. The middle icon is Regular. Try setting a different one and then print the attribute again.

1 Like

Ok, so if I understand correctly these “glyphs”, are a default set of icons baked into the app. Therefore I would expect them to be represented in the glyphs3 schema as an enum with a clear set of names. Florian, what do you think?

Correct, there is a baked-in set of icons that can be referenced in iconName.

I am not sure I would consider it an enum, because Glyphs might very well offer additional icons in a future version and that would not feel like an update of the file format to me. Still, I could add a list of string values that are currently to be expected to the schema docs.


(A custom glyph as icon is stored as a custom parameter, not iconName.)

1 Like

Fair enough. Could you drop here a list of the current options?

Also, another thing that caught my attention. If the width of a layer is a required attribute, why does width have a default value? Also, the default is different from the API, if I create a GSLayer() from scratch I get a width of 600upms.