Skip to content

fontlab.flPropertyPoint

flPropertyPoint

2-D point axis-driven attribute.

What is flPropertyPoint?

flPropertyPoint is like flPropertyDouble but for a 2-D coordinate (x and y together). Guideline positions and anchor positions can be driven by separate formula expressions for their x and y components. flPropertyPoint holds both component expressions and the current evaluated point value.

The paramType property controls how the x and y values are interpreted — whether they represent an absolute coordinate, a delta from the default position, or an angle-and-distance pair. In most scripting contexts, paramType does not need to be changed.

Tutorial

flPropertyPoint is most commonly encountered when inspecting formula-driven guideline or anchor positions.

import fontlab as fl

# ============================================================
# Check all font-level guidelines for expression-driven
# positions. Guidelines that use formulas (like "=xHeight")
# have their position stored as an flPropertyPoint internally.
# ============================================================

font = fl.CurrentFont()

print("Font-level guidelines:")
for gl in font.guidelines:
    # flGuideLine exposes its y-expression directly:
    ey = gl.expressionY if hasattr(gl, 'expressionY') else None
    if ey and hasattr(ey, 'hasExpression') and ey.hasExpression():
        driven = f"formula: '{ey.expression}'"
    else:
        pos_y = gl.centerPoint.y()
        driven = f"fixed y={pos_y:.0f}"
    print(f"  '{gl.name or '(unnamed)'}': {driven}")

# ============================================================
# Read the current evaluated position of a formula guideline.
# After flPropertiesProcessor.process() the .point property
# holds the computed (x, y) value.
# ============================================================

for shape in font['A'].layers[0].shapes:
    proc = getattr(shape, "propertiesProcessor", None)
    if not proc:
        continue
    for attr, prop in proc.properties.items():
        # Check if this is a point property (has .point attribute)
        if hasattr(prop, 'point') and hasattr(prop, 'expressionX'):
            pt = prop.point
            has_expr = prop.hasExpression()
            print(f"  Point property '{attr}': ({pt.x():.1f}, {pt.y():.1f})  "
                  f"formula-driven={has_expr}")

Common Scripting Patterns

List all formula-driven guideline positions

import fontlab as fl

font = fl.CurrentFont()
for gl in font.guidelines:
    expr = gl.expression   # the expression string if any
    if expr:
        print(f"'{gl.name}': formula='{expr}'  pos={gl.centerPoint.y():.0f}")

flPropertyPoint.ParameterType

Use the flPropertyPoint.ParameterType dictionary with subscription.

Key Native value Description
HorzLine flPropertyPoint::ParameterType::HorzLine Native enum value.
VertLine flPropertyPoint::ParameterType::VertLine Native enum value.
Point flPropertyPoint::ParameterType::Point Native enum value.

Inherited binding members: flObject.

Constructors:

Native bases: object

Captured native MRO: flPropertyPoint, object

Native new allocation evidence (not an init overload): (args, *kwargs) Create and return a new object. See help(type) for accurate signature.

Supplemental documentation: A point property. The captured declaration exposes hasExpression, and the attributes point, paramType, ParameterType, expressionX, expressionY. It is created with no captured constructor overloads. It also carries the shared object members changed, clone, cloneObject, getProperty, setProperty, release, remove and update and the shared attributes id, name, type, isValid and isNull.

Source: FontLab Proteus API documentation

Source: generated/fontlab.py: flPropertyPoint captured declaration

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
ParameterType attribute dict
__init__ function (self, /, *args: Any, **kwargs: Any) -> None Initialize self. (shared captured text)
changed function (self) -> Any (shared captured text)
checkInitHistoryState function (self, history_ix: int) -> Any (shared captured text)
clearAboveHistory function (self, history_ix: int) -> Any (shared captured text)
clearFlag function (self, f: int) -> Any (shared captured text)
clearFlags function (self) -> Any (shared captured text)
clone function (self, *args: Any, **kwargs: Any) -> Any Clone the object (shared captured text)
cloneObject function (*args: Any, **kwargs: Any) -> Any (shared captured text)
createObject function (*args: Any, **kwargs: Any) -> Any FlObject/Nothing createObject(int); (shared captured text)
currentHistoryState function (self, *args: Any, **kwargs: Any) -> Any (shared captured text)
expressionX attribute Any The formula that computes the x component.
expressionY attribute Any The formula that computes the y component.
flObjectFlags attribute dict (shared captured text)
flag function (self, f: int) -> Any (shared captured text)
getProperties function (self, *args: Any, **kwargs: Any) -> Any Get object's properties list (shared captured text)
getProperty function (self, *args: Any, **kwargs: Any) -> Any Get object property by 'key' or number (shared captured text)
getPropertyFloat function (self, *args: Any, **kwargs: Any) -> Any Get float object property by 'key' (shared captured text)
getPropertyInt function (self, *args: Any, **kwargs: Any) -> Any Get int object property by 'key' (shared captured text)
hasChanges attribute Any (shared captured text)
hasExpression function (self) -> bool Returns True if either the x or y component has a non-empty formula string.
hasHistoryState function (self, history_ix: int) -> Any (shared captured text)
hasHistoryStates attribute Any (shared captured text)
haveObject function (*args: Any, **kwargs: Any) -> Any (shared captured text)
historyStates function (self, accepted_state: bool) -> Any (shared captured text)
id attribute Any Object id (shared captured text)
independedAll function (self) -> Any (shared captured text)
initialHistoryState function (self, *args: Any, **kwargs: Any) -> Any (shared captured text)
instanceType function (*args: Any, **kwargs: Any) -> Any (shared captured text)
isChanged attribute Any (shared captured text)
isEqual function (self, arg0: flObject) -> Any (shared captured text)
isNull attribute Any (shared captured text)
isPresent attribute Any (shared captured text)
isReleased attribute Any (shared captured text)
isValid attribute Any (shared captured text)
name attribute Any Object name (shared captured text)
paramType attribute Any Controls how the point coordinates are interpreted.
point attribute Any The current x,y value after the most recent evaluation.
propertyNames function (self, *args: Any, **kwargs: Any) -> Any PropertyNames(): sorted snapshot of dynamic property keys (shared captured text)
refCnt attribute Any Object references count (shared captured text)
release function (self) -> Any (shared captured text)
remove function (self, *args: Any, **kwargs: Any) -> Any (shared captured text)
removeChild function (self, arg0: flObject) -> Any (shared captured text)
restoreHistoryState function (self, history_ix: int) -> Any (shared captured text)
setFlag function (self, *args: Any, **kwargs: Any) -> Any (shared captured text)
setProperty function (self, *args: Any, **kwargs: Any) -> Any Set object property by 'key' or number (shared captured text)
setPropertyFloat function (self, *args: Any, **kwargs: Any) -> Any Set float object property by 'key' (shared captured text)
setPropertyInt function (self, *args: Any, **kwargs: Any) -> Any Set int object property by 'key' (shared captured text)
tag function (self, *args: Any, **kwargs: Any) -> Any (shared captured text)
type attribute Any Object type (shared captured text)
update function (self) -> Any (shared captured text)