Skip to content

fontlab.fgSymbol · declarations 001

Back to fontlab.fgSymbol

DataCode instance-attribute

DataCode: dict

clear

clear() -> Any

clear()

Resets all fields to their unset state — no Unicode, no name, no ID. After calling this, the symbol is essentially blank and will match nothing.

Source: FontLab Proteus API documentation

clearData

clearData(DataCode: Any) -> Any

clearData(DataCode)

Removes the custom data entry for DataCode from this symbol.

Source: FontLab Proteus API documentation

clearID

clearID() -> Any

clearID()

Clears only the font-specific ID fields (id, pid, glyphIndex), while keeping any attached custom data. Useful when transferring symbols between fonts: clear the old font's IDs, then call computeID(newFont) to resolve them in the new font.

Source: FontLab Proteus API documentation

clearPresentationOverride

clearPresentationOverride() -> Any

clearPresentationOverride()

Clears both the named master/layer and explicit location, restoring inheritance from the current context.

Source: FontLab Proteus API documentation

compare

compare(arg0: fgSymbol) -> bool

bool compare(fgSymbol)

Returns True if this symbol and the given symbol identify the same character — same Unicode value or same glyph ID, depending on what is set. Use this to search a symbol list for a specific character.

Source: FontLab Proteus API documentation

computeID

computeID(arg0: fgFont) -> bool

bool computeID(fgFont)

Looks up this symbol's glyph name or Unicode in the given font and fills in the id, pid, and glyphIndex fields. Returns True if the glyph was found. Call this when you have built a symbol from a name/unicode and need to resolve it within a specific font.

Source: FontLab Proteus API documentation

containsData

containsData(DataCode: Any) -> bool

bool containsData(DataCode)

Returns True if custom data has been stored under DataCode. Always check this before calling data(code) to avoid getting an empty QVariant.

Source: FontLab Proteus API documentation

cr instance-attribute

cr: Any

bool

True if this symbol is a carriage-return/line-break character. Use this to detect line breaks in a symbol list.

Source: FontLab Proteus API documentation

data

data(DataCode: Any) -> Any

QVariant data(DataCode)

Returns the custom data stored under the given DataCode key. Custom data is arbitrary Python values (numbers, strings, etc.) that you can attach to any symbol for your own bookkeeping. Use integer codes to distinguish different data types.

Source: FontLab Proteus API documentation

empty instance-attribute

empty: Any

bool

True if no glyph has been assigned — both unicode is zero and name is empty. An empty symbol renders as a missing-glyph box.

Source: FontLab Proteus API documentation

glyph

glyph(arg0: fgFont, setId: bool) -> fgGlyph

fgGlyph glyph(fgFont, bool setId)

Returns the fgGlyph (fontgate glyph) from fgFont that this symbol identifies. If setId is True, updates this symbol's id field with the resolved glyph ID. Returns Nothing if the glyph cannot be found.

Source: FontLab Proteus API documentation

glyphIndex instance-attribute

glyphIndex: Any

int

The zero-based index of the glyph in the font's glyph array. Set after computeID() succeeds.

Source: FontLab Proteus API documentation

hasLocation instance-attribute

hasLocation: Any

bool

Whether this occurrence has an explicit location. An explicitly empty location still returns True; use clearPresentationOverride() to restore inheritance.

Source: FontLab Proteus API documentation

hasName instance-attribute

hasName: Any

bool

True if a glyph name has been explicitly assigned.

Source: FontLab Proteus API documentation

hasUnicode instance-attribute

hasUnicode: Any

bool

True if a Unicode code point has been explicitly assigned.

Source: FontLab Proteus API documentation

id instance-attribute

id: Any

unsigned long

The glyph slot index in the font. This is the number FontLab uses internally to quickly find the glyph. May change if glyphs are reordered; use pid for stable references.

Source: FontLab Proteus API documentation

init

init() -> Any

init()

Initialises all fields to their default values. Similar to clear() but uses explicit defaults.

Source: FontLab Proteus API documentation

layerName instance-attribute

layerName: Any

string

Requested master/layer name, e.g. "Light". Use setLayerOverride() when switching from a location: assigning this property alone preserves an existing location, which takes precedence. With no location and an empty name, the symbol inherits the current context.

Source: FontLab Proteus API documentation

ligatureIndex instance-attribute

ligatureIndex: Any

int

For ligature components, the index of this symbol within its ligature cluster (0-based). -1 if this is not a ligature component.

Source: FontLab Proteus API documentation

location instance-attribute

location: Any

flLocation

Copy of the explicit design coordinates for this occurrence. Read axis values with symbol.location["wt"]. Use setLocation() to apply changes.

Source: FontLab Proteus API documentation

name instance-attribute

name: Any

QString

The glyph name for this symbol (e.g. "A", "uni00E9", "ligature_fi"). Empty if only a Unicode or ID has been set.

Source: FontLab Proteus API documentation

pid instance-attribute

pid: Any

unsigned long

The persistent glyph ID — stable across glyph reordering and most editing operations. Prefer pid over id when storing references that need to survive file saves and reloads.

Source: FontLab Proteus API documentation

setData

setData(DataCode: Any, d: Any) -> Any

setData(DataCode, QVariant d)

Stores the value d under DataCode. You can store any Python value that Qt can wrap in a QVariant — numbers, strings, and lists all work.

Source: FontLab Proteus API documentation

setLayerOverride

setLayerOverride(string: Any) -> Any

setLayerOverride(string)

Selects a named master/layer for this occurrence and clears any explicit location. An empty name restores inheritance.

Source: FontLab Proteus API documentation

setLocation

setLocation(arg0: flLocation) -> Any

setLocation(flLocation)

Sets explicit design coordinates for this occurrence and clears the named master/layer override. Copies the supplied location.

Source: FontLab Proteus API documentation

setSterile

setSterile() -> Any

setSterile()

Marks this symbol as sterile — it will be included in the text string but will not generate a visible glyph when rendered. Used for control characters and formatting signals.

Source: FontLab Proteus API documentation

space instance-attribute

space: Any

bool

True if this symbol is a space character (Unicode space, non-breaking space, etc.).

Source: FontLab Proteus API documentation

unicode instance-attribute

unicode: Any

uint

The Unicode code point directly assigned to this symbol, or 0 if none. This does NOT compute from the name.

Source: FontLab Proteus API documentation

unicodeEnsure instance-attribute

unicodeEnsure: Any

uint

Returns the Unicode code point, computing it from the glyph name if not already stored. This is the "best effort" unicode getter — use it when you need a Unicode value and aren't sure if one has been set.

Source: FontLab Proteus API documentation