Interface UserScaledFontInitFunc

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface UserScaledFontInitFunc
UserScaledFontInitFunc is the type of function which is called when a scaled-font needs to be created for a user font-face.

The cairo context cr is not used by the caller, but is prepared in font space, similar to what the cairo contexts passed to the renderGlyph method will look like. The callback can use this context for extents computation for example. After the callback is called, cr is checked for any error status.

The extents argument is where the user font sets the font extents for scaledFont. It is in font space, which means that for most cases its ascent and descent members should add to 1.0. extents is preset to hold a value of 1.0 for ascent, height, and maxXAdvance, and 0.0 for descent and maxYAdvance members.

The callback is optional. If not set, default font extents as described in the previous paragraph will be used.

Note that scaledFont is not fully initialized at this point and trying to use it for text operations in the callback will result in deadlock.

Since:
1.8