fontlab.flShapeData · declarations 001
addContour
addContour(arg0: flContour) -> Any
addContour(flContour)
Appends a single contour to the end of this shape data's contour list. The contour becomes owned by the shape data.
Source: FontLab Proteus API documentation
addContours
addContours(*args: Any, **kwargs: Any) -> Any
addContours(list(flContour))
Appends multiple contours in a single call. More efficient than looping addContour when you have a batch of contours ready.
Source: FontLab Proteus API documentation
arrangeContours
arrangeContours() -> bool
bool arrangeContours()
Reorders the contours so that outer (clockwise) contours come before inner (counter-clockwise) contours. Returns True if any reordering was performed. This ordering is required for correct fill rendering in most font rendering engines — if your outlines look wrong after import, calling this is often the fix.
Source: FontLab Proteus API documentation
assignContours
assignContours(*args: Any, **kwargs: Any) -> Any
QMap
Replaces all existing contours with the supplied list. Unlike clearContours + addContours, this returns a mapping from old object IDs to the new contour objects — essential when you need to maintain cross-references (for example, anchor-to-contour links) after a bulk contour replacement.
Source: FontLab Proteus API documentation
bindDependencies
bindDependencies() -> Any
bindDependencies()
Reconnects all internal dependency links — builder dependencies, property processors, and component references. Call this after manually assembling or rearranging a shape data object from pieces. If you create an flShapeData from scratch and add contours to it, calling bindDependencies() ensures everything is wired up correctly before the shape data is rendered or exported.
Source: FontLab Proteus API documentation
builder
instance-attribute
builder: Any
flObject builder()
The active flShapeBuilder attached to this shape data, or Nothing if this is a plain drawn shape. Cast with fl.flShapeBuilder(sd.builder) to use builder-specific methods. See flShapeBuilder.
Source: FontLab Proteus API documentation
clearContours
clearContours() -> Any
clearContours()
Removes every contour from this shape data, leaving it empty. The shape data object still exists; it just has no drawing content. Useful for resetting a shape data before rebuilding it from scratch.
Source: FontLab Proteus API documentation
clearIncludesList
clearIncludesList() -> Any
clearIncludesList()
Empties the list of included (composited) child shapes. Does not delete the child shapes themselves — they are simply detached from this composite.
Source: FontLab Proteus API documentation
componentGlyph
instance-attribute
componentGlyph: Any
string
For component shapes: the name of the glyph whose artwork this shape data references. For example, if an "Á" uses the "acute" glyph as a component, componentGlyph would be "acute". Empty string for non-component shapes.
Source: FontLab Proteus API documentation
componentLayer
instance-attribute
componentLayer: Any
string
For component shapes: which layer within componentGlyph to reference. When empty, FontLab uses the default (matching) layer. You can set this explicitly to pin a component to a specific master layer by name.
Source: FontLab Proteus API documentation
contours
instance-attribute
contours: Any
list(flContour) contours()
All contours belonging to this shape data. Read-only via this property — use addContour, removeContour, etc. to make changes.
Source: FontLab Proteus API documentation
goDown
goDown(arg0: flShape) -> bool
bool goDown(flShape)
Moves the specified child shape one step toward the back of the rendering order (rendered later, closer to the front of the visual stack). Returns True if the move was possible. Equivalent to nudging a layer down in a stack.
Source: FontLab Proteus API documentation
goUp
goUp(arg0: flShape) -> bool
bool goUp(flShape)
Moves the specified child shape one step toward the front of the rendering order. Returns True if the move was possible.
Source: FontLab Proteus API documentation
includes
instance-attribute
includes: Any
flObjectsList
The raw include list as an flObjectsList. For most scripting purposes, includesList() (the method) returns a plain Python list and is easier to work with.
Source: FontLab Proteus API documentation
includesList
includesList() -> Any
list(flShape) includesList()
isComponent
instance-attribute
isComponent: Any
bool
True if this shape data is a component reference (its contours come from another glyph). When True, componentGlyph and componentLayer are meaningful.
Source: FontLab Proteus API documentation
isComposite
instance-attribute
isComposite: Any
bool
True if this shape data contains an include list of child shapes (composite structure). When True, iterate includesList() instead of contours.
Source: FontLab Proteus API documentation
note
instance-attribute
note: Any
string
A free-text annotation you can attach to any shape data. Does not affect rendering or export. Useful for tagging shapes with source information, generation parameters, or review notes when scripting batch operations.
Source: FontLab Proteus API documentation
prepareTransformationData
prepareTransformationData() -> Any
prepareTransformationData()
Pre-computes and caches the geometric state needed for interactive transformations (rotate, scale, shear). You must call this before applying any transform to this shape data. Failing to call it first can produce incorrect results or crashes during live transformation.
Source: FontLab Proteus API documentation
referenceCount
instance-attribute
referenceCount: Any
int
How many flShape objects currently point to this shape data. When referenceCount == 1, this data is private to one shape and safe to edit directly. When referenceCount > 1, this is a shared component — edits here will affect every glyph that includes this data. Treat this as read-only in most scripts; FontLab manages reference counting automatically.
Source: FontLab Proteus API documentation
removeAnchor
removeAnchor(arg0: flAnchor) -> Any
removeAnchor(flAnchor)
Removes the specified anchor from this shape data. Use flShape.getAnchors() to obtain anchor objects, then pass them here if you need to remove at the data level.
Source: FontLab Proteus API documentation
removeContour
removeContour(arg0: flContour) -> Any
removeContour(flContour)
Removes a specific contour from this shape data. Pass the exact flContour object obtained from contours.
Source: FontLab Proteus API documentation
resetTransformationData
resetTransformationData() -> Any
resetTransformationData()
Discards the transformation cache created by prepareTransformationData(). Call this after a transformation is finished or cancelled to free the cached memory.
Source: FontLab Proteus API documentation
segments
instance-attribute
segments: Any
list(CurveEx) segments()
All Bézier curve segments from all contours in this shape data, expressed as CurveEx objects. Each CurveEx carries four control points. This is a convenient flat representation for geometric processing without iterating contours and nodes individually.
Source: FontLab Proteus API documentation
sendToBack
sendToBack(arg0: flShape) -> bool
bool sendToBack(flShape)
Moves the specified child shape all the way to the back of the compositing order in one call. Returns True if moved.
Source: FontLab Proteus API documentation
sendToFront
sendToFront(arg0: flShape) -> bool
bool sendToFront(flShape)
Moves the specified child shape all the way to the front of the compositing order. Returns True if moved.
Source: FontLab Proteus API documentation
shapeType
instance-attribute
shapeType: Any
ShapeType shapeType()
An enum value describing the kind of shape data: flContour (plain drawn shape), Composite (contains included children), Image (holds a bitmap), or AccentInfo (references another glyph). Read this to decide how to process the shape data without guessing.
Source: FontLab Proteus API documentation
sortContours
sortContours(action: bool) -> Any
sortContours(bool action)
Sorts the contour list into a canonical order. If action is True, the sort is committed to the model; if False, it is a dry-run that computes the sort without modifying anything. Useful for normalising contour order before interpolation.
Source: FontLab Proteus API documentation
takeIncludesList
takeIncludesList() -> Any
list(flShape) takeIncludesList()