When drawing with a reporter plugin, I often need to get values from the parent font of the current layer. In G4, the parent now switches from a GSFont to GSInterpolationFontProxy when I view an interpolation. That means that I have to query different attributes depending on the parent type, which is a bit inconvenient
The second example doesn’t even work, because both classes have gridLength, it just is a float or int for GSFont, and an objc.native_selector for GSInterpolationFontProxy.
(I just added them to the wrapper, so until that is live, you need to add ())
To round a point to the grid.
grid = master.roundingSettings()
point = GSFontMaster.alignPoint_toGrid_type_(point, grid, 1)
the grid is defined like this:
typedef struct GSGridSettings {
/// The effective interval for rounding horizontal coordinates.
CGFloat lengthHorizontal;
/// The effective interval for rounding vertical coordinates.
CGFloat lengthVertical;
/// The horizontal length of the main grid before subdivision.
uint32_t mainHorizontal;
/// The vertical length of the main grid before subdivision.
uint32_t mainVertical;
/// The number of horizontal subdivisions of the main grid.
uint32_t subDivisionHorizontal;
/// The number of vertical subdivisions of the main grid.
uint32_t subDivisionVertical;
/// The rise component of the grid slope.
int32_t slopeRise;
/// The run component of the grid slope.
int32_t slopeRun;
} GSGridSettings;