Skip to content

fontlab.flModel · declarations 001

Back to fontlab.flModel

ModelType instance-attribute

ModelType: dict

ObjectParameter instance-attribute

ObjectParameter: dict

createObject

createObject(type: int) -> Any

flObject/Nothing createObject(int type)

Creates a new, blank object of the given ModelType code. Returns the new object, or Nothing if the type can't be instantiated this way. Useful when you need to build an object programmatically rather than getting it from a font.

Source: FontLab Proteus API documentation

getClassMask

getClassMask(type: int) -> int

int getClassMask(int type)

Returns a bitmask describing which base-class categories this type belongs to. Used internally for fast type hierarchy checks without needing RTTI.

Source: FontLab Proteus API documentation

instance

instance() -> flModel

flModel instance()

Returns the application-wide flModel singleton. You rarely need this directly — most methods work as class-level calls.

Source: FontLab Proteus API documentation

isClassMask

isClassMask(type: int) -> bool

bool isClassMask(int type)

Returns True if the given constant is a class-mask bitmask rather than a concrete object type ID.

Source: FontLab Proteus API documentation

notifyGlyphChanged

notifyGlyphChanged(fg_glyphId: Any) -> Any

notifyGlyphChanged(unsigned long fg_glyphId)

Full data-changed notification. Tells FontLab that the glyph's data has changed. This triggers the heavier update cycle: metrics recalculation, preview refresh, and all dependent displays. Use this after any real edit to node positions, contour structure, or spacing.

Source: FontLab Proteus API documentation

notifyGlyphUpdate

notifyGlyphUpdate(fg_glyphId: Any) -> Any

notifyGlyphUpdate(unsigned long fg_glyphId)

Lightweight refresh. Tells FontLab to redraw the canvas for this glyph, but doesn't trigger metrics recalculation or preview regeneration. Use this for purely visual updates — for example, when you've moved a display element but haven't changed the actual outline data.

Source: FontLab Proteus API documentation

notifyGlyphsChanged

notifyGlyphsChanged(glyphs: set[Any]) -> Any

notifyGlyphsChanged(QSet glyphs)

Batch notification. Same as notifyGlyphChanged but for multiple glyphs at once. Much more efficient than calling notifyGlyphChanged in a loop — FontLab can process all the updates together. Use this whenever your script touches more than one glyph.

Source: FontLab Proteus API documentation

typeToStr

typeToStr(flObject: Any) -> str

QString typeToStr(int type | flObject)

Returns the human-readable name for a type code or object. Handy for debugging: pass any font object and get back a string like "Node" or "Shape".

Source: FontLab Proteus API documentation