About properties

I have two questions about the new properties in G3:

1- some — but not all — parameters available as properties can be also be added or accessed directly as attributes of the font or instance classes. Doesnt seem to make much of a difference (parameters set as attributes get added as properties anyway), but should I favor dealing with those with the new GSFontInfoValueSingle objects, or is it okay to use the attributes when available (I guess will this be available long term is the question)?

2- I dont think I have seen this mentioned in the doc, but I can still add GSFontInfoValue objects that dont have a supported key (doesnt appear in the UI but still there). Was this intended to store data, like userData, or should I not use them like that?

  1. Those direct properties are just shortcuts to make it easier in the general case. Have a look at the wrapper how they are implemented.

  2. That is not supposed to hold private data.

1 Like

Figured as much. Thanks @GeorgSeifert!

Replying to this to not spam the forum:

ID1 and ID2 for Windows are still there as styleMapFamilyName and styleMapStyleName, but also as windowsFamily and windowsStyle, which are basically just new attributes for the same thing. I’m guessing some of these are here for legacy reasons, so which ones should I use now?

I see the doubling in the python API. It seems that the styleMap… properties are better. The windows… properties will compute something if there is nothing set. So the former might return None.