fontlab.flMarkerPoint
flMarkerPoint
Snap Line Measurement Marker.
What is flMarkerPoint?
Guidelines in FontLab can carry measurement markers — small tick marks that represent stem widths, zone boundaries, or sidebearing measurements. An flMarkerPoint is one such tick mark. It sits at a specific position along the guideline and carries flag bits that describe what kind of measurement it represents.
Most designers interact with markers through the Snap/Measure panel rather than in scripts. But if you are writing a tool that programmatically creates or analyses measurement data attached to guidelines, flMarkerPoint gives you direct access to each marker's position and role flags.
Tutorial
import fontlab as fl
# ============================================================
# Inspect all marker points on all guidelines in the current
# glyph layer. Each guideline can carry zero or more markers.
# ============================================================
font = fl.CurrentFont()
glyph = font['H'] # 'H' often has stems worth measuring
layer = glyph.layers[0]
for guide in layer.guides:
markers = guide.markers # list of flMarkerPoint
if not markers:
continue
print(f"Guideline at angle {guide.angle:.0f}°:")
for m in markers:
kind = "stem" if m.isStem else "other"
sel = " [selected]" if m.isSelected else ""
print(f" position={m.position:.0f} type={kind} "
f"key={m.key} flags={m.markerFlags:#010b}{sel}")
# ============================================================
# Create a new stem marker and attach it to the first guide.
# ============================================================
if layer.guides:
guide = layer.guides[0]
new_marker = fl.flMarkerPoint.createInstance()
new_marker.position = 80.0 # 80 units from guideline centre
new_marker.isStem = True # mark it as a stem edge
guide.addMarker(new_marker)
fl.Update()
print(f"\nAdded stem marker at position 80 to first guideline.")
Common Scripting Patterns
List all hand-placed markers across all glyphs
import fontlab as fl
font = fl.CurrentFont()
for glyph in font.glyphs:
layer = glyph.layers[0]
for guide in layer.guides:
for m in guide.markers:
if str(m.key) == 'HandMarker':
print(f"{glyph.name}: hand marker at {m.position:.0f}")
Check if a guideline has any stem markers
import fontlab as fl
font = fl.CurrentFont()
glyph = font['H']
layer = glyph.layers[0]
for i, guide in enumerate(layer.guides):
stem_markers = [m for m in guide.markers if m.isStem]
print(f"Guide {i}: {len(stem_markers)} stem marker(s)")
Inherited binding members: flObject.
Constructors: flMarkerPoint() flMarkerPoint(flObject) flMarkerPoint(flMarkerPoint) flMarkerPoint(double marker_pos, uint markerFlags, flSnaps::MarkerKey key)
Native bases: object
Captured native MRO: flMarkerPoint, 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:
Marker point. The captured declaration exposes markerFlag, setMarkerFlag, markerFlags, isStem, isSelected, key and position. 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: flMarkerPoint 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 |
|---|---|---|---|
__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) |
createInstance |
function | () -> flMarkerPoint |
Factory method: creates a detached flMarkerPoint that you can then configure and attach to a guideline. |
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) |
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) |
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) |
isSelected |
attribute | Any |
True if this marker is currently selected in the editor. |
isStem |
attribute | Any |
True if this marker represents a stem edge (a black stroke boundary) rather than a zone boundary or vertical metric line. |
isValid |
attribute | Any |
(shared captured text) |
key |
attribute | Any |
The marker's classification: UndefinedMarker, HandMarker (placed manually by the designer), AutoMarker (detected automatically by FontLab), or AnyKeyMarker (used as a wildcard when querying). |
markerFlag |
function | (self, role: int) -> int |
Returns the flag bits for the given role. |
markerFlags |
attribute | Any |
The combined bitmask of all flags across all roles. |
name |
attribute | Any |
Object name (shared captured text) |
position |
attribute | Any |
The position of this marker along its parent guideline, measured in glyph units from the guideline's reference point. |
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) |
setMarkerFlag |
function | (self, role: int, markerFlags: int) -> Any |
Sets all flag bits for the given role to markerFlags. |
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) |