typerig.proxy.objects.glyph
typerig.proxy.objects.glyph (version 0.26.9)
# MODULE: Typerig / Proxy / Glyph # ----------------------------------------------------------- # (C) Vassil Kateliev, 2017-2020 (http://www.kateliev.com) # (C) Karandash Type Foundry (http://www.karandash.eu) #------------------------------------------------------------ # www.typerig.com
Modules
- fontgate
- fontlab
- math
- PythonQt
- fontTools.pens.statisticsPen
Classes
class eGlyph(pGlyph)
Extended representation of the Proxy Glyph, adding some advanced functionality Constructor: pGlyph() - default represents the current glyph and current font pGlyph(fgFont, fgGlyph)
- Method resolution order:
- eGlyph
- pGlyph
- builtin.object
Methods
- bindCompMetrics(self, layer=None, bindIndex=None)
-
Auto bind metrics to the base composite glyph or to specified shape index
- blendLayers(self, layerA, layerB, blendTimes, outputFL=True, blendMode=0, engine='fg')
-
Blend two layers at given times (anisotropic support). Args: layerA (flLayer), layerB (flLayer): Shapes to be interpolated blendTimes (int or float or tuple(float, float)): (int) for percent 0%-100% or (float) time for both X,Y or tuple(float,float) times for anisotropic blending outputFL (bool): Return blend native format or flShape (default) blendMode (int): ? engine (str): 'fg' for FontGate (in-build). Returns: flLayer
- breakContour(self, contourId, nodeId, layer=None, expand=0)
-
Split Contour at given node and layer. Extrapolate line endings if needed. Args: contourId (int): Contour Index nodeId (int): Node Index layer (int or str): Layer index or name, works with both expand (float): Will extrapolate the line endings at that given value Returns: flContour
- copyADVbyName(self, glyphName, layers=None, adjustPercent=100, adjustUnits=0)
-
Copy Advance width from another glyph specified by Glyph Name. Args: glyphName (str): Name of source glyph layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. adjustPercent (int): Adjust the copied metric by percent (100 default) adjustUnits (int): Adjust the copied metric by units (0 default) Return: None
- copyLSBbyName(self, glyphName, layers=None, order=0, adjustPercent=100, adjustUnits=0)
-
Copy LSB from another glyph specified by Glyph Name. Args: glyphName (str): Name of source glyph layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. order (bool or int): Use source LSB (0 False) or RSB (1 True). Flips the metric copied. adjustPercent (int): Adjust the copied metric by percent (100 default) adjustUnits (int): Adjust the copied metric by units (0 default) Return: None
- copyMetricsbyName(self, metricTriple=(None, None, None), layers=None, order=(0, 0, 0), adjustPercent=(100, 100, 100), adjustUnits=(0, 0, 0))
-
Copy LSB, RSB and Advance width from glyphs specified by Glyph Name. Args: metricTriple tuple(str): Names of source glyphs for (LSB, RSB, ADV) layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. order tuple(bool): Use source LSB (0 False) or RSB (1 True). Flips the metric copied. (LSB, RSB, 0) adjustPercent tuple(int): Adjust the copied metric by percent (100 default) - (LSB, RSB, ADV) adjustUnits tuple(int): Adjust the copied metric by units (0 default) - (LSB, RSB, ADV) Return: None
- copyRSBbyName(self, glyphName, layers=None, order=0, adjustPercent=100, adjustUnits=0)
-
Copy RSB from another glyph specified by Glyph Name. Args: glyphName (str): Name of source glyph layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. order (bool or int): Use source LSB (0 False) or RSB (1 True). Flips the metric copied. adjustPercent (int): Adjust the copied metric by percent (100 default) adjustUnits (int): Adjust the copied metric by units (0 default) Return: None
- dropAnchor(self, name, layer, coordTuple, alignTuple=(None, None), tolerance=5, italic=False)
-
Drop anchor at given layer Args: name (str): Anchor Name layer (int or str): Layer index or name, works with both coordTuple (int, int): New anchor coordinates or auto aligment offsets* alignTuple (str,str): New anchor aligment* tolerance (int): Outline feature auto detection tolerance* *Aligment rules: (width, height) - (None,None) - Uses coordinates given - width - (L) Left; (R) Right; (A) Auto Bottom with tolerance; (AT) Auto Top with tolerance; (C) Center; - height - (T) Top; (B) Bottom; (C) Center; Returns: None
- dropGuide(self, nodes=None, layers=None, name='*DropGuideline', tag='', color='darkMagenta', flip=(1, 1), style='gsGlyphGuideline')
-
Build guideline trough *any two* given points or the *first two of the current selection*. If *single point* is given will create a vertical guideline trough that point, with guideline inclined according to the font's Italic Angle. if process layers (pLayers) is None guideline will be created in all compatible layers, otherwise the bool control tuple (active_layer (True or False), masters (True or False), masks (True or False), services (True or False)) is used. If all are set to False only the active layer is used. Args: nodes (list(int)): List of node indexes layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. name (str): Name of the guideline to be build color (str): Color of the guideline according to QtCore colors style (str): Style of the guideline according to FontLab 6 Returns: None
- getAttachmentCenters(self, layer, tolerance=5, applyTransform=True, getAll=False)
-
Return X center of lowest, highest Y of [glyph] for [layer] within given [tolerance] Note: Determine diacritic to glyph attachment positions (for anchor placement)
- getNewBaseCoords(self, layer, adjustTuple, alignTuple, tolerance=5, italic=False, initPosTuple=(0.0, 0.0))
-
Calculate Anchor base position Args: layer (int or str): Layer index or name, works with both coordTuple (int/float, int/float): New anchor coordinates or auto aligment offsets* alignTuple (str,str): New anchor aligment* tolerance (int/float): Outline feature auto detection tolerance* initPosTuple (int/float, int/float): Itinital anchor position *Aligment rules: (width, height) - (None,None) - Uses coordinates given - width - (L) Left; (R) Right; (A) Auto Bottom with tolerance; (AT) Auto Top with tolerance; (C) Center; - height - (T) Top; (B) Bottom; (C) Center; Returns: x, y (int/float)
- lerpLayerFg(self, l0_Name, l1_Name)
- moveAnchor(self, name, layer, coordTuple=(0, 0), alignTuple=(None, None), tolerance=5, italic=False)
-
Move anchor at given layer Args: name (str): Anchor Name layer (int or str): Layer index or name, works with both coordTuple (int, int): New anchor coordinates or auto aligment offsets* alignTuple (str,str): New anchor aligment* tolerance (int): Outline feature auto detection tolerance* *Aligment rules: (width, height) - (None,None) - Uses coordinates given - width - (L) Left; (R) Right; (A) Auto Bottom with tolerance; (AT) Auto Top with tolerance; (C) Center; - height - (T) Top; (B) Bottom; (C) Center; Returns: None
- reorder_shapes(self, layer=None, mode=(0, 0))
-
Auto reorder shapes on given layer using criteria. Args: layer (int or str): Layer index or name, works with both mode (bool, bool): Mode of shape reordering/sorting by (X, Y) Returns: None
- setStart(self, layer=None, control=(0, 0))
- splitContour(self, scnPairs=None, layers=None, expand=0, close=False)
-
Split Contour at given node and combinations of compatible layers. Extrapolate line endings and close contour if needed. Args: scnPairs (list(tuple)): Shape-contour-node pairs for the selected nodes [(Shape Index, Contour Index, Node Index)..()] layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. expand (float): Will extrapolate the line endings at that given value close (bool): True = Close contour Return: None
- ungroup_all_shapes(self, layer=None, applyTransform=True)
-
Ungroup all shapes at given layer. Args: layer (int or str): Layer index or name, works with both applyTransform (bool): Apply transformation at shape. Returns: None
Methods from pGlyph
- init(self, *argv)
- repr(self)
- activeGuides(self)
- activeLayer(self)
- addAnchor(self, coordTuple, name, layer=None, isAnchor=True)
-
Adds named Anchor at given layer. Args: coordTuple (tuple(float,float)): Anchor coordinates X, Y name (str): Anchor name layer (int or str): Layer index or name. If None returns ActiveLayer isAnchor (bool): True creates a true flAnchor, False ? (flPinPoint) Returns: None
- addComponents(self, componentConfig, layer=None, useAnchors=True, colorize=False)
-
Adds a components to given glyph layer. Args: componentConfig (list(tuple(glyph_name (str), glyph_transform (QTransform), layer_pointer (str)))): List contianign component configuration. layer (int or str): Layer index or name. If None returns ActiveLayer useAnchors (bool): Compose using anchors colorize (bool): Flag new glyphs Returns: list(flShapes): List of components added
- addGuideline(self, coordTuple, layer=None, angle=0, name='', tag='', color='darkMagenta', style='gsGlyphGuideline')
-
Adds named Guideline at given layer Args: coordTuple (tuple(float,float) or tuple(float,float,float,float)): Guideline coordinates X, Y and given angle or two node reference x1,y1 and x2,y2 name (str): Anchor name angle (float): Incline of the guideline layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- addLayer(self, layer, toBack=False)
-
Adds a layer to glyph. Args: layer (flLayer or fgLayer) toBack (bool): Send layer to back Returns: None
- addShape(self, shape, layer=None, clone=False)
-
Add a new shape at given layer. Args: shape (flShape): Shape to be added Returns: flShape
- addShapeContainer(self, shapeList, layer=None, remove=True)
-
Add a new shape container* at given layer. A flShape containing all of the shapes given that could be transformed to Shape-group or shape-filter. Args: shapeList list(flShape): List if Shapes to be grouped. Returns: flShape
- anchors(self, layer=None)
-
Return list of anchors (list[flAnchor]) at given layer (int or str)
- blendShapes(self, shapeA, shapeB, blendTimes, outputFL=True, blendMode=0, engine='fg')
-
Blend two shapes at given times (anisotropic support). Args: shapeA (flShape), shapeB (flShape): Shapes to be interpolated blendTimes (int or float or tuple(float, float)): (int) for percent 0%-100% or (float) time for both X,Y or tuple(float,float) times for anisotropic blending outputFL (bool): Return blend native format or flShape (default) blendMode (int): ? engine (str): 'fg' for FontGate (in-build). Returns: Native (interpolation engine dependent) or flShape (default)
- clearAnchors(self, layer=None)
-
Remove all anchors at given layer (int or str)
- components(self, layer=None, extend=None)
-
Return all glyph components besides glyph.
- containers(self, layer=None, extend=None)
-
Return all complex shapes that contain other shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
- contours(self, layer=None, deep=True, extend=None)
-
Return all contours at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flContours]
- copyLayer(self, srcLayerName, dstLayerName, options={'adv': True, 'anc': True, 'gui': True, 'lnk': True, 'lsb': True, 'out': True, 'ref': True, 'rsb': True}, addLayer=False, cleanDST=True, toBack=True)
-
Copies a layer within the glyph. Args: srcLayerName, dstLayerName (string): Source and destination layer names options (dict): Copy Options as follows {'out': Outline, 'gui': Guidelines, 'anc': Anchors, 'lsb': LSB, 'adv': Advance, 'rsb': RSB, 'lnk': Linked metrics, 'ref': References}, addLayer=False): addLayer (bool): Create a new layer cleanDST (bool): Clean destination layer toBack (bool): Add layer to back of the layer stack Returns: flLayer
- decompose(self, layer=None)
-
Decompose all complex shapes that contain other shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- dereference(self, layer=None)
-
Remove all shape references but leave components. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
- draw(self, pen, layer=None)
-
Utilizes the Pen protocol
- drawPoints(self, pen, layer=None)
-
Utilizes the PointPen protocol
- duplicateLayer(self, layer=None, newLayerName='New Layer', references=False)
-
Duplicates a layer with new name and adds it to glyph's layers. Args: layer (int or str): Layer index or name. If None returns ActiveLayer toBack(bool): send to back Returns: flLayer
- elements(self, layer=None, extend=None)
-
Return all glyph elements in glyph
- fg_activeLayer(self)
- fg_contours(self, layer=None)
-
Return all FontGate contours at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgContours]
- fg_hasLayer(self, layerName)
- fg_layer(self, layer=None)
-
Returns FontGate layer no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: fgLayer
- fg_layers(self, asDict=False)
-
Return all FotnGate layers
- fg_nodes(self, layer=None)
-
Return all FontGate nodes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgNodes]
- fg_shapes(self, layer=None)
-
Return all FontGate shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgShapes]
- findAnchor(self, anchorName, layer=None)
-
Find anchor by name/tag
- findAnchorCoords(self, anchorName, layer=None)
-
Find anchor coordinates by name/tag
- findNode(self, nodeName, layer=None)
-
Find node by name/tag
- findNodeCoords(self, nodeName, layer=None)
-
Find node coordinates by name/tag
- findShape(self, shapeName, layer=None)
-
Finds shape by name on given layer Args: shapeName (str): Shape name layer (int or str): Layer index or name. If None returns ActiveLayer Returns: flShape or None
- fontMetricsInfo(self, layer=None)
-
Returns Font(layer) metrics no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: FontMetrics (object)
- getAdvance(self, layer=None)
-
Get the Advance Width at given layer (int or str)
- getBounds(self, layer=None)
-
Get Glyph's Boundig Box at given layer (int or str). Returns QRectF.
- getBuilders(self, layer=None, store=False)
- getCompositionDict(self, layer=None)
-
Return composition dict of a glyph. Elements!
- getCompositionNames(self, layer=None)
-
Return name of glyph and the parts it is made of.
- getElementNames(self, layer=None)
-
Return names of elements references used in glyph.
- getLSB(self, layer=None)
-
Get the Left Side-bearing at given layer (int or str)
- getRSB(self, layer=None)
-
Get the Right Side-bearing at given layer (int or str)
- getSBeq(self, layer=None)
-
GET LSB, RSB metric equations on given layer
- getSegment(self, cID, nID, layer=None)
-
Returns contour segment of the node specified at given layer Args: cID (int): Contour index nID (int): Node of insertion index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: CurveEx
- getTags(self)
-
# - Tags -----------------------------------------------
- guidelines(self, layer=None)
-
Return list of guidelines (list[flGuideline]) at given layer (int or str)
- hasLayer(self, layerName)
- insertNodeAt(self, cID, nID_time, layer=None)
-
Inserts node in contour at specified layer Arg: cID (int): Contour Index nID_time (float): Node index + float time layer (int or str): Layer index or name. If None returns ActiveLayer !NOTE: FL6 treats contour insertions (as well as nodes) as float times along contour, so inserting a node at .5 t between nodes with indexes 3 and 4 will be 3 (index) + 0.5 (time) = 3.5
- insertNodesAt(self, cID, nID, nodeList, layer=None)
-
Inserts a list of nodes to specified contour, starting at given index all on layer specified. Args: cID (int): Contour index nID (int): Node of insertion index nodeList (list): List of flNode objects layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- isCompatible(self, strong=False)
-
Test if glyph is ready for interpolation - all master layers are compatible.
- isMixedReference(self)
-
Test if glyph has mixed references - components on some layers and referenced shapes on others
- italicAngle(self)
- layer(self, layer=None)
-
Returns layer no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: flLayer
- layers(self)
-
Return all layers
- mLine(self)
- mapNodes2Times(self, layer=None)
-
Create map of Nodes at contour times for every contour in given layer Returns: dict{Contour index (int) : dict{Contour Time (int): Node Index (int) }}
- mapTimes2Nodes(self, layer=None)
-
Create map of Contour times at node indexes for every contour in given layer Returns: dict{Contour index (int) : dict{Node Index (int) : Contour Time (int) }}
- mask(self)
- masks(self)
-
Returns all mask layers.
- masters(self)
-
Returns all master layers.
- newAnchor(self, coordTuple, name, anchorType=1)
-
Not working
- nodes(self, layer=None, extend=None, deep=False)
-
Return all nodes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer. extend (class): A class construct with extended functionality to be applied on every node. Returns: list[flNodes]
- nodes4segments(self, cID, layer=None)
-
Returns all contour segments and their corresponding nodes at given layer Args: cID (int): Contour index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: dict{time(int):(CurveEx, list[flNode]}
- nodesForIndices(self, indices, layer=None, filterOn=False, extend=None, deep=False)
- noncomplex(self, layer=None, extend=None)
-
Return all glyph shapes that are not glyph references or components
- object(self)
- removeLayer(self, layer)
-
Removes a layer from glyph. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- removeNodeAt(self, cID, nID, layer=None)
-
Removes a node from contour at layer specified. Args: cID (int): Contour index nID (int): Index of Node to be removed layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- removeNodes(self, cID, nodeList, layer=None)
-
Removes a list of nodes from contour at layer specified. Args: cID (int): Contour index nodeList (list): List of flNode objects layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- removeShape(self, shape, layer=None, recursive=True)
-
Remove a new shape at given layer. Args: old_shape, new_shape (flShape): Shapes layer (str): Layer name recursive (bool): Returns: None
- replaceShape(self, old_shape, new_shape, layer=None)
-
Repalce a shape at given layer. Args: old_shape, new_shape (flShape): Shapes layer (str): Layer name Returns: None
- reportLayerComp(self, strong=False)
-
Returns a layer compatibility report
- rotate(self, deg, layer=None)
-
Rotate outline at given layer. Args: deg (float): degrees of slant layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- scale(self, sx, sy, layer=None)
-
Scale outline at given layer. Args: sx (float), sy (float): delta (scaling) X, Y layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- segments(self, cID, layer=None)
-
Returns all contour segments at given layer Args: cID (int): Contour index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[CurveEx]
- selected(self, filterOn=False, deep=False)
-
Return all selected nodes indexes at current layer. Args: filterOn (bool): Return only on-curve nodes Returns: list[int]
- selectedAtContours(self, index=True, layer=None, filterOn=False, deep=False)
-
Return all selected nodes and the contours they rest upon at current layer. Args: index (bool): If True returns only indexes, False returns flContour, flNode filterOn (bool): Return only on-curve nodes Returns: list[tuple(int, int)]: [(contourID, nodeID)..()] or list[tuple(flContour, flNode)]
- selectedAtShapes(self, index=True, filterOn=False, layer=None, deep=False)
-
Return all selected nodes and the shapes they belong at current layer. Args: index (bool): If True returns only indexes, False returns flShape, flNode filterOn (bool): Return only on-curve nodes Returns: list[tuple(int, int)]: [(shapeID, nodeID)..()] or list[tuple(flShape, flNode)] !TODO: Make it working with layers as selectedAtContours(). This is legacy mode so other scripts would work!
- selectedContours(self, layer=None, allNodesSelected=False)
- selectedCoords(self, layer=None, filterOn=False, applyTransform=False)
-
Return the coordinates of all selected nodes at the current layer or other. Args: layer (int or str): Layer index or name. If None returns ActiveLayer filterOn (bool): Return only on-curve nodes applyTransform (bool) : Gets local shape transformation matrix and applies it to the node coordinates Returns: list[QPointF]
- selectedNodeIndices(self, filterOn=False, deep=False)
-
Return all indices of nodes selected at current layer. Args: filterOn (bool): Return only on-curve nodes Returns: list[int]
- selectedNodes(self, layer=None, filterOn=False, extend=None, deep=False)
-
Return all selected nodes at given layer. Args: filterOn (bool): Return only on-curve nodes extend (class): A class construct with extended functionality to be applied on every node. Returns: list[flNode]
- selectedNodesOnCanvas(self, filterOn=False)
-
# - Glyph Selection -----------------------------------------------
- selectedSegments(self, layer=None)
-
Returns list of currently selected segments Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[CurveEx]
- selectedShapeIndices(self, select_all=False, deep=False)
-
Return all indices of nodes selected at current layer. Args: select_all (bool): True all nodes on Shape should be selected. False any node will do. Returns: list[int]
- selectedShapes(self, layer=None, select_all=False, deep=False, extend=None)
-
Return all shapes that have a node selected.
- services(self)
-
Returns all service layers.
- setADVeq(self, equationStr, layer=None)
-
Set Advance width metric equation on given layer
- setAdvance(self, newAdvance, layer=None)
-
Set the Advance Width (int) at given layer (int or str)
- setLSB(self, newLSB, layer=None)
-
Set the Left Side-bearing (int) at given layer (int or str)
- setLSBeq(self, equationStr, layer=None)
-
Set LSB metric equation on given layer
- setMark(self, mark_color, layer=None)
- setName(self, glyph_name)
- setRSB(self, newRSB, layer=None)
-
Set the Right Side-bearing (int) at given layer (int or str)
- setRSBeq(self, equationStr, layer=None)
-
Set RSB metric equation on given layer
- setTags(self, tagList, append=True)
- shapes(self, layer=None, extend=None)
-
Return all shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
- shapes_data(self, layer=None)
-
Return all flShapeData objects at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapeData]
- slant(self, deg, layer=None)
-
Slant outline at given layer. Args: deg (float): degrees of slant layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- tag(self, newTag)
- translate(self, dx, dy, layer=None)
-
Translate (shift) outline at given layer. Args: dx (float), dy (float): delta (shift) X, Y layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- update(self, fl=True, fg=False)
-
Updates the glyph and sends notification to the editor. Args: fl (bool): Update the flGlyph fg (bool): Update the fgGlyph
- updateObject(self, flObject, undoMessage='TypeRig', verbose=True)
-
Updates a flObject sends notification to the editor as well as undo/history item. Args: flObject (flGlyph, flLayer, flShape, flNode, flContour): Object to be update and set undo state undoMessage (string): Message to be added in undo/history list.
- version(self)
-
# - Basics -----------------------------------------------
Descriptors from pGlyph
- dict
-
dictionary for instance variables (if defined)
- weakref
-
list of weak references to the object (if defined)
- id
- index
- mark
- name
- package
- tags
- unicode
- unicodes
class pGlyph(builtin.object)
Proxy to flGlyph and fgGlyph combined into single entity. Constructor: pGlyph() : default represents the current glyph and current font pGlyph(flGlyph) pGlyph(fgFont, fgGlyph) Methods: Attributes: .parent (fgFont) .fg (fgGlyph) .fl (flGlyph) ...
Methods
- init(self, *argv)
- repr(self)
- activeGuides(self)
- activeLayer(self)
- addAnchor(self, coordTuple, name, layer=None, isAnchor=True)
-
Adds named Anchor at given layer. Args: coordTuple (tuple(float,float)): Anchor coordinates X, Y name (str): Anchor name layer (int or str): Layer index or name. If None returns ActiveLayer isAnchor (bool): True creates a true flAnchor, False ? (flPinPoint) Returns: None
- addComponents(self, componentConfig, layer=None, useAnchors=True, colorize=False)
-
Adds a components to given glyph layer. Args: componentConfig (list(tuple(glyph_name (str), glyph_transform (QTransform), layer_pointer (str)))): List contianign component configuration. layer (int or str): Layer index or name. If None returns ActiveLayer useAnchors (bool): Compose using anchors colorize (bool): Flag new glyphs Returns: list(flShapes): List of components added
- addGuideline(self, coordTuple, layer=None, angle=0, name='', tag='', color='darkMagenta', style='gsGlyphGuideline')
-
Adds named Guideline at given layer Args: coordTuple (tuple(float,float) or tuple(float,float,float,float)): Guideline coordinates X, Y and given angle or two node reference x1,y1 and x2,y2 name (str): Anchor name angle (float): Incline of the guideline layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- addLayer(self, layer, toBack=False)
-
Adds a layer to glyph. Args: layer (flLayer or fgLayer) toBack (bool): Send layer to back Returns: None
- addShape(self, shape, layer=None, clone=False)
-
Add a new shape at given layer. Args: shape (flShape): Shape to be added Returns: flShape
- addShapeContainer(self, shapeList, layer=None, remove=True)
-
Add a new shape container* at given layer. A flShape containing all of the shapes given that could be transformed to Shape-group or shape-filter. Args: shapeList list(flShape): List if Shapes to be grouped. Returns: flShape
- anchors(self, layer=None)
-
Return list of anchors (list[flAnchor]) at given layer (int or str)
- blendShapes(self, shapeA, shapeB, blendTimes, outputFL=True, blendMode=0, engine='fg')
-
Blend two shapes at given times (anisotropic support). Args: shapeA (flShape), shapeB (flShape): Shapes to be interpolated blendTimes (int or float or tuple(float, float)): (int) for percent 0%-100% or (float) time for both X,Y or tuple(float,float) times for anisotropic blending outputFL (bool): Return blend native format or flShape (default) blendMode (int): ? engine (str): 'fg' for FontGate (in-build). Returns: Native (interpolation engine dependent) or flShape (default)
- clearAnchors(self, layer=None)
-
Remove all anchors at given layer (int or str)
- components(self, layer=None, extend=None)
-
Return all glyph components besides glyph.
- containers(self, layer=None, extend=None)
-
Return all complex shapes that contain other shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
- contours(self, layer=None, deep=True, extend=None)
-
Return all contours at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flContours]
- copyLayer(self, srcLayerName, dstLayerName, options={'adv': True, 'anc': True, 'gui': True, 'lnk': True, 'lsb': True, 'out': True, 'ref': True, 'rsb': True}, addLayer=False, cleanDST=True, toBack=True)
-
Copies a layer within the glyph. Args: srcLayerName, dstLayerName (string): Source and destination layer names options (dict): Copy Options as follows {'out': Outline, 'gui': Guidelines, 'anc': Anchors, 'lsb': LSB, 'adv': Advance, 'rsb': RSB, 'lnk': Linked metrics, 'ref': References}, addLayer=False): addLayer (bool): Create a new layer cleanDST (bool): Clean destination layer toBack (bool): Add layer to back of the layer stack Returns: flLayer
- decompose(self, layer=None)
-
Decompose all complex shapes that contain other shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- dereference(self, layer=None)
-
Remove all shape references but leave components. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
- draw(self, pen, layer=None)
-
Utilizes the Pen protocol
- drawPoints(self, pen, layer=None)
-
Utilizes the PointPen protocol
- duplicateLayer(self, layer=None, newLayerName='New Layer', references=False)
-
Duplicates a layer with new name and adds it to glyph's layers. Args: layer (int or str): Layer index or name. If None returns ActiveLayer toBack(bool): send to back Returns: flLayer
- elements(self, layer=None, extend=None)
-
Return all glyph elements in glyph
- fg_activeLayer(self)
- fg_contours(self, layer=None)
-
Return all FontGate contours at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgContours]
- fg_hasLayer(self, layerName)
- fg_layer(self, layer=None)
-
Returns FontGate layer no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: fgLayer
- fg_layers(self, asDict=False)
-
Return all FotnGate layers
- fg_nodes(self, layer=None)
-
Return all FontGate nodes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgNodes]
- fg_shapes(self, layer=None)
-
Return all FontGate shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgShapes]
- findAnchor(self, anchorName, layer=None)
-
Find anchor by name/tag
- findAnchorCoords(self, anchorName, layer=None)
-
Find anchor coordinates by name/tag
- findNode(self, nodeName, layer=None)
-
Find node by name/tag
- findNodeCoords(self, nodeName, layer=None)
-
Find node coordinates by name/tag
- findShape(self, shapeName, layer=None)
-
Finds shape by name on given layer Args: shapeName (str): Shape name layer (int or str): Layer index or name. If None returns ActiveLayer Returns: flShape or None
- fontMetricsInfo(self, layer=None)
-
Returns Font(layer) metrics no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: FontMetrics (object)
- getAdvance(self, layer=None)
-
Get the Advance Width at given layer (int or str)
- getBounds(self, layer=None)
-
Get Glyph's Boundig Box at given layer (int or str). Returns QRectF.
- getBuilders(self, layer=None, store=False)
- getCompositionDict(self, layer=None)
-
Return composition dict of a glyph. Elements!
- getCompositionNames(self, layer=None)
-
Return name of glyph and the parts it is made of.
- getElementNames(self, layer=None)
-
Return names of elements references used in glyph.
- getLSB(self, layer=None)
-
Get the Left Side-bearing at given layer (int or str)
- getRSB(self, layer=None)
-
Get the Right Side-bearing at given layer (int or str)
- getSBeq(self, layer=None)
-
GET LSB, RSB metric equations on given layer
- getSegment(self, cID, nID, layer=None)
-
Returns contour segment of the node specified at given layer Args: cID (int): Contour index nID (int): Node of insertion index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: CurveEx
- getTags(self)
-
# - Tags -----------------------------------------------
- guidelines(self, layer=None)
-
Return list of guidelines (list[flGuideline]) at given layer (int or str)
- hasLayer(self, layerName)
- insertNodeAt(self, cID, nID_time, layer=None)
-
Inserts node in contour at specified layer Arg: cID (int): Contour Index nID_time (float): Node index + float time layer (int or str): Layer index or name. If None returns ActiveLayer !NOTE: FL6 treats contour insertions (as well as nodes) as float times along contour, so inserting a node at .5 t between nodes with indexes 3 and 4 will be 3 (index) + 0.5 (time) = 3.5
- insertNodesAt(self, cID, nID, nodeList, layer=None)
-
Inserts a list of nodes to specified contour, starting at given index all on layer specified. Args: cID (int): Contour index nID (int): Node of insertion index nodeList (list): List of flNode objects layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- isCompatible(self, strong=False)
-
Test if glyph is ready for interpolation - all master layers are compatible.
- isMixedReference(self)
-
Test if glyph has mixed references - components on some layers and referenced shapes on others
- italicAngle(self)
- layer(self, layer=None)
-
Returns layer no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: flLayer
- layers(self)
-
Return all layers
- mLine(self)
- mapNodes2Times(self, layer=None)
-
Create map of Nodes at contour times for every contour in given layer Returns: dict{Contour index (int) : dict{Contour Time (int): Node Index (int) }}
- mapTimes2Nodes(self, layer=None)
-
Create map of Contour times at node indexes for every contour in given layer Returns: dict{Contour index (int) : dict{Node Index (int) : Contour Time (int) }}
- mask(self)
- masks(self)
-
Returns all mask layers.
- masters(self)
-
Returns all master layers.
- newAnchor(self, coordTuple, name, anchorType=1)
-
Not working
- nodes(self, layer=None, extend=None, deep=False)
-
Return all nodes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer. extend (class): A class construct with extended functionality to be applied on every node. Returns: list[flNodes]
- nodes4segments(self, cID, layer=None)
-
Returns all contour segments and their corresponding nodes at given layer Args: cID (int): Contour index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: dict{time(int):(CurveEx, list[flNode]}
- nodesForIndices(self, indices, layer=None, filterOn=False, extend=None, deep=False)
- noncomplex(self, layer=None, extend=None)
-
Return all glyph shapes that are not glyph references or components
- object(self)
- removeLayer(self, layer)
-
Removes a layer from glyph. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- removeNodeAt(self, cID, nID, layer=None)
-
Removes a node from contour at layer specified. Args: cID (int): Contour index nID (int): Index of Node to be removed layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- removeNodes(self, cID, nodeList, layer=None)
-
Removes a list of nodes from contour at layer specified. Args: cID (int): Contour index nodeList (list): List of flNode objects layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- removeShape(self, shape, layer=None, recursive=True)
-
Remove a new shape at given layer. Args: old_shape, new_shape (flShape): Shapes layer (str): Layer name recursive (bool): Returns: None
- replaceShape(self, old_shape, new_shape, layer=None)
-
Repalce a shape at given layer. Args: old_shape, new_shape (flShape): Shapes layer (str): Layer name Returns: None
- reportLayerComp(self, strong=False)
-
Returns a layer compatibility report
- rotate(self, deg, layer=None)
-
Rotate outline at given layer. Args: deg (float): degrees of slant layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- scale(self, sx, sy, layer=None)
-
Scale outline at given layer. Args: sx (float), sy (float): delta (scaling) X, Y layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- segments(self, cID, layer=None)
-
Returns all contour segments at given layer Args: cID (int): Contour index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[CurveEx]
- selected(self, filterOn=False, deep=False)
-
Return all selected nodes indexes at current layer. Args: filterOn (bool): Return only on-curve nodes Returns: list[int]
- selectedAtContours(self, index=True, layer=None, filterOn=False, deep=False)
-
Return all selected nodes and the contours they rest upon at current layer. Args: index (bool): If True returns only indexes, False returns flContour, flNode filterOn (bool): Return only on-curve nodes Returns: list[tuple(int, int)]: [(contourID, nodeID)..()] or list[tuple(flContour, flNode)]
- selectedAtShapes(self, index=True, filterOn=False, layer=None, deep=False)
-
Return all selected nodes and the shapes they belong at current layer. Args: index (bool): If True returns only indexes, False returns flShape, flNode filterOn (bool): Return only on-curve nodes Returns: list[tuple(int, int)]: [(shapeID, nodeID)..()] or list[tuple(flShape, flNode)] !TODO: Make it working with layers as selectedAtContours(). This is legacy mode so other scripts would work!
- selectedContours(self, layer=None, allNodesSelected=False)
- selectedCoords(self, layer=None, filterOn=False, applyTransform=False)
-
Return the coordinates of all selected nodes at the current layer or other. Args: layer (int or str): Layer index or name. If None returns ActiveLayer filterOn (bool): Return only on-curve nodes applyTransform (bool) : Gets local shape transformation matrix and applies it to the node coordinates Returns: list[QPointF]
- selectedNodeIndices(self, filterOn=False, deep=False)
-
Return all indices of nodes selected at current layer. Args: filterOn (bool): Return only on-curve nodes Returns: list[int]
- selectedNodes(self, layer=None, filterOn=False, extend=None, deep=False)
-
Return all selected nodes at given layer. Args: filterOn (bool): Return only on-curve nodes extend (class): A class construct with extended functionality to be applied on every node. Returns: list[flNode]
- selectedNodesOnCanvas(self, filterOn=False)
-
# - Glyph Selection -----------------------------------------------
- selectedSegments(self, layer=None)
-
Returns list of currently selected segments Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[CurveEx]
- selectedShapeIndices(self, select_all=False, deep=False)
-
Return all indices of nodes selected at current layer. Args: select_all (bool): True all nodes on Shape should be selected. False any node will do. Returns: list[int]
- selectedShapes(self, layer=None, select_all=False, deep=False, extend=None)
-
Return all shapes that have a node selected.
- services(self)
-
Returns all service layers.
- setADVeq(self, equationStr, layer=None)
-
Set Advance width metric equation on given layer
- setAdvance(self, newAdvance, layer=None)
-
Set the Advance Width (int) at given layer (int or str)
- setLSB(self, newLSB, layer=None)
-
Set the Left Side-bearing (int) at given layer (int or str)
- setLSBeq(self, equationStr, layer=None)
-
Set LSB metric equation on given layer
- setMark(self, mark_color, layer=None)
- setName(self, glyph_name)
- setRSB(self, newRSB, layer=None)
-
Set the Right Side-bearing (int) at given layer (int or str)
- setRSBeq(self, equationStr, layer=None)
-
Set RSB metric equation on given layer
- setTags(self, tagList, append=True)
- shapes(self, layer=None, extend=None)
-
Return all shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
- shapes_data(self, layer=None)
-
Return all flShapeData objects at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapeData]
- slant(self, deg, layer=None)
-
Slant outline at given layer. Args: deg (float): degrees of slant layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- tag(self, newTag)
- translate(self, dx, dy, layer=None)
-
Translate (shift) outline at given layer. Args: dx (float), dy (float): delta (shift) X, Y layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- update(self, fl=True, fg=False)
-
Updates the glyph and sends notification to the editor. Args: fl (bool): Update the flGlyph fg (bool): Update the fgGlyph
- updateObject(self, flObject, undoMessage='TypeRig', verbose=True)
-
Updates a flObject sends notification to the editor as well as undo/history item. Args: flObject (flGlyph, flLayer, flShape, flNode, flContour): Object to be update and set undo state undoMessage (string): Message to be added in undo/history list.
- version(self)
-
# - Basics -----------------------------------------------
Descriptors
- dict
-
dictionary for instance variables (if defined)
- weakref
-
list of weak references to the object (if defined)
- id
- index
- mark
- name
- package
- tags
- unicode
- unicodes
pGlyph
typerig.proxy.objects.glyph.pGlyph = class pGlyph(__builtin__.object)
Proxy to flGlyph and fgGlyph combined into single entity. Constructor: pGlyph() : default represents the current glyph and current font pGlyph(flGlyph) pGlyph(fgFont, fgGlyph) Methods: Attributes: .parent (fgFont) .fg (fgGlyph) .fl (flGlyph) ...
Methods
- __init__(self, *argv)
- __repr__(self)
- activeGuides(self)
- activeLayer(self)
- addAnchor(self, coordTuple, name, layer=None, isAnchor=True)
-
Adds named Anchor at given layer. Args: coordTuple (tuple(float,float)): Anchor coordinates X, Y name (str): Anchor name layer (int or str): Layer index or name. If None returns ActiveLayer isAnchor (bool): True creates a true flAnchor, False ? (flPinPoint) Returns: None
- addComponents(self, componentConfig, layer=None, useAnchors=True, colorize=False)
-
Adds a components to given glyph layer. Args: componentConfig (list(tuple(glyph_name (str), glyph_transform (QTransform), layer_pointer (str)))): List contianign component configuration. layer (int or str): Layer index or name. If None returns ActiveLayer useAnchors (bool): Compose using anchors colorize (bool): Flag new glyphs Returns: list(flShapes): List of components added
- addGuideline(self, coordTuple, layer=None, angle=0, name='', tag='', color='darkMagenta', style='gsGlyphGuideline')
-
Adds named Guideline at given layer Args: coordTuple (tuple(float,float) or tuple(float,float,float,float)): Guideline coordinates X, Y and given angle or two node reference x1,y1 and x2,y2 name (str): Anchor name angle (float): Incline of the guideline layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- addLayer(self, layer, toBack=False)
-
Adds a layer to glyph. Args: layer (flLayer or fgLayer) toBack (bool): Send layer to back Returns: None
- addShape(self, shape, layer=None, clone=False)
-
Add a new shape at given layer. Args: shape (flShape): Shape to be added Returns: flShape
- addShapeContainer(self, shapeList, layer=None, remove=True)
-
Add a new shape container* at given layer. A flShape containing all of the shapes given that could be transformed to Shape-group or shape-filter. Args: shapeList list(flShape): List if Shapes to be grouped. Returns: flShape
- anchors(self, layer=None)
-
Return list of anchors (list[flAnchor]) at given layer (int or str)
- blendShapes(self, shapeA, shapeB, blendTimes, outputFL=True, blendMode=0, engine='fg')
-
Blend two shapes at given times (anisotropic support). Args: shapeA (flShape), shapeB (flShape): Shapes to be interpolated blendTimes (int or float or tuple(float, float)): (int) for percent 0%-100% or (float) time for both X,Y or tuple(float,float) times for anisotropic blending outputFL (bool): Return blend native format or flShape (default) blendMode (int): ? engine (str): 'fg' for FontGate (in-build). Returns: Native (interpolation engine dependent) or flShape (default)
- clearAnchors(self, layer=None)
-
Remove all anchors at given layer (int or str)
- components(self, layer=None, extend=None)
-
Return all glyph components besides glyph.
- containers(self, layer=None, extend=None)
-
Return all complex shapes that contain other shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
- contours(self, layer=None, deep=True, extend=None)
-
Return all contours at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flContours]
- copyLayer(self, srcLayerName, dstLayerName, options={'adv': True, 'anc': True, 'gui': True, 'lnk': True, 'lsb': True, 'out': True, 'ref': True, 'rsb': True}, addLayer=False, cleanDST=True, toBack=True)
-
Copies a layer within the glyph. Args: srcLayerName, dstLayerName (string): Source and destination layer names options (dict): Copy Options as follows {'out': Outline, 'gui': Guidelines, 'anc': Anchors, 'lsb': LSB, 'adv': Advance, 'rsb': RSB, 'lnk': Linked metrics, 'ref': References}, addLayer=False): addLayer (bool): Create a new layer cleanDST (bool): Clean destination layer toBack (bool): Add layer to back of the layer stack Returns: flLayer
- decompose(self, layer=None)
-
Decompose all complex shapes that contain other shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- dereference(self, layer=None)
-
Remove all shape references but leave components. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
- draw(self, pen, layer=None)
-
Utilizes the Pen protocol
- drawPoints(self, pen, layer=None)
-
Utilizes the PointPen protocol
- duplicateLayer(self, layer=None, newLayerName='New Layer', references=False)
-
Duplicates a layer with new name and adds it to glyph's layers. Args: layer (int or str): Layer index or name. If None returns ActiveLayer toBack(bool): send to back Returns: flLayer
- elements(self, layer=None, extend=None)
-
Return all glyph elements in glyph
- fg_activeLayer(self)
- fg_contours(self, layer=None)
-
Return all FontGate contours at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgContours]
- fg_hasLayer(self, layerName)
- fg_layer(self, layer=None)
-
Returns FontGate layer no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: fgLayer
- fg_layers(self, asDict=False)
-
Return all FotnGate layers
- fg_nodes(self, layer=None)
-
Return all FontGate nodes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgNodes]
- fg_shapes(self, layer=None)
-
Return all FontGate shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgShapes]
- findAnchor(self, anchorName, layer=None)
-
Find anchor by name/tag
- findAnchorCoords(self, anchorName, layer=None)
-
Find anchor coordinates by name/tag
- findNode(self, nodeName, layer=None)
-
Find node by name/tag
- findNodeCoords(self, nodeName, layer=None)
-
Find node coordinates by name/tag
- findShape(self, shapeName, layer=None)
-
Finds shape by name on given layer Args: shapeName (str): Shape name layer (int or str): Layer index or name. If None returns ActiveLayer Returns: flShape or None
- fontMetricsInfo(self, layer=None)
-
Returns Font(layer) metrics no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: FontMetrics (object)
- getAdvance(self, layer=None)
-
Get the Advance Width at given layer (int or str)
- getBounds(self, layer=None)
-
Get Glyph's Boundig Box at given layer (int or str). Returns QRectF.
- getBuilders(self, layer=None, store=False)
- getCompositionDict(self, layer=None)
-
Return composition dict of a glyph. Elements!
- getCompositionNames(self, layer=None)
-
Return name of glyph and the parts it is made of.
- getElementNames(self, layer=None)
-
Return names of elements references used in glyph.
- getLSB(self, layer=None)
-
Get the Left Side-bearing at given layer (int or str)
- getRSB(self, layer=None)
-
Get the Right Side-bearing at given layer (int or str)
- getSBeq(self, layer=None)
-
GET LSB, RSB metric equations on given layer
- getSegment(self, cID, nID, layer=None)
-
Returns contour segment of the node specified at given layer Args: cID (int): Contour index nID (int): Node of insertion index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: CurveEx
- getTags(self)
-
# - Tags -----------------------------------------------
- guidelines(self, layer=None)
-
Return list of guidelines (list[flGuideline]) at given layer (int or str)
- hasLayer(self, layerName)
- insertNodeAt(self, cID, nID_time, layer=None)
-
Inserts node in contour at specified layer Arg: cID (int): Contour Index nID_time (float): Node index + float time layer (int or str): Layer index or name. If None returns ActiveLayer !NOTE: FL6 treats contour insertions (as well as nodes) as float times along contour, so inserting a node at .5 t between nodes with indexes 3 and 4 will be 3 (index) + 0.5 (time) = 3.5
- insertNodesAt(self, cID, nID, nodeList, layer=None)
-
Inserts a list of nodes to specified contour, starting at given index all on layer specified. Args: cID (int): Contour index nID (int): Node of insertion index nodeList (list): List of flNode objects layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- isCompatible(self, strong=False)
-
Test if glyph is ready for interpolation - all master layers are compatible.
- isMixedReference(self)
-
Test if glyph has mixed references - components on some layers and referenced shapes on others
- italicAngle(self)
- layer(self, layer=None)
-
Returns layer no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: flLayer
- layers(self)
-
Return all layers
- mLine(self)
- mapNodes2Times(self, layer=None)
-
Create map of Nodes at contour times for every contour in given layer Returns: dict{Contour index (int) : dict{Contour Time (int): Node Index (int) }}
- mapTimes2Nodes(self, layer=None)
-
Create map of Contour times at node indexes for every contour in given layer Returns: dict{Contour index (int) : dict{Node Index (int) : Contour Time (int) }}
- mask(self)
- masks(self)
-
Returns all mask layers.
- masters(self)
-
Returns all master layers.
- newAnchor(self, coordTuple, name, anchorType=1)
-
Not working
- nodes(self, layer=None, extend=None, deep=False)
-
Return all nodes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer. extend (class): A class construct with extended functionality to be applied on every node. Returns: list[flNodes]
- nodes4segments(self, cID, layer=None)
-
Returns all contour segments and their corresponding nodes at given layer Args: cID (int): Contour index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: dict{time(int):(CurveEx, list[flNode]}
- nodesForIndices(self, indices, layer=None, filterOn=False, extend=None, deep=False)
- noncomplex(self, layer=None, extend=None)
-
Return all glyph shapes that are not glyph references or components
- object(self)
- removeLayer(self, layer)
-
Removes a layer from glyph. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- removeNodeAt(self, cID, nID, layer=None)
-
Removes a node from contour at layer specified. Args: cID (int): Contour index nID (int): Index of Node to be removed layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- removeNodes(self, cID, nodeList, layer=None)
-
Removes a list of nodes from contour at layer specified. Args: cID (int): Contour index nodeList (list): List of flNode objects layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- removeShape(self, shape, layer=None, recursive=True)
-
Remove a new shape at given layer. Args: old_shape, new_shape (flShape): Shapes layer (str): Layer name recursive (bool): Returns: None
- replaceShape(self, old_shape, new_shape, layer=None)
-
Repalce a shape at given layer. Args: old_shape, new_shape (flShape): Shapes layer (str): Layer name Returns: None
- reportLayerComp(self, strong=False)
-
Returns a layer compatibility report
- rotate(self, deg, layer=None)
-
Rotate outline at given layer. Args: deg (float): degrees of slant layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- scale(self, sx, sy, layer=None)
-
Scale outline at given layer. Args: sx (float), sy (float): delta (scaling) X, Y layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- segments(self, cID, layer=None)
-
Returns all contour segments at given layer Args: cID (int): Contour index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[CurveEx]
- selected(self, filterOn=False, deep=False)
-
Return all selected nodes indexes at current layer. Args: filterOn (bool): Return only on-curve nodes Returns: list[int]
- selectedAtContours(self, index=True, layer=None, filterOn=False, deep=False)
-
Return all selected nodes and the contours they rest upon at current layer. Args: index (bool): If True returns only indexes, False returns flContour, flNode filterOn (bool): Return only on-curve nodes Returns: list[tuple(int, int)]: [(contourID, nodeID)..()] or list[tuple(flContour, flNode)]
- selectedAtShapes(self, index=True, filterOn=False, layer=None, deep=False)
-
Return all selected nodes and the shapes they belong at current layer. Args: index (bool): If True returns only indexes, False returns flShape, flNode filterOn (bool): Return only on-curve nodes Returns: list[tuple(int, int)]: [(shapeID, nodeID)..()] or list[tuple(flShape, flNode)] !TODO: Make it working with layers as selectedAtContours(). This is legacy mode so other scripts would work!
- selectedContours(self, layer=None, allNodesSelected=False)
- selectedCoords(self, layer=None, filterOn=False, applyTransform=False)
-
Return the coordinates of all selected nodes at the current layer or other. Args: layer (int or str): Layer index or name. If None returns ActiveLayer filterOn (bool): Return only on-curve nodes applyTransform (bool) : Gets local shape transformation matrix and applies it to the node coordinates Returns: list[QPointF]
- selectedNodeIndices(self, filterOn=False, deep=False)
-
Return all indices of nodes selected at current layer. Args: filterOn (bool): Return only on-curve nodes Returns: list[int]
- selectedNodes(self, layer=None, filterOn=False, extend=None, deep=False)
-
Return all selected nodes at given layer. Args: filterOn (bool): Return only on-curve nodes extend (class): A class construct with extended functionality to be applied on every node. Returns: list[flNode]
- selectedNodesOnCanvas(self, filterOn=False)
-
# - Glyph Selection -----------------------------------------------
- selectedSegments(self, layer=None)
-
Returns list of currently selected segments Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[CurveEx]
- selectedShapeIndices(self, select_all=False, deep=False)
-
Return all indices of nodes selected at current layer. Args: select_all (bool): True all nodes on Shape should be selected. False any node will do. Returns: list[int]
- selectedShapes(self, layer=None, select_all=False, deep=False, extend=None)
-
Return all shapes that have a node selected.
- services(self)
-
Returns all service layers.
- setADVeq(self, equationStr, layer=None)
-
Set Advance width metric equation on given layer
- setAdvance(self, newAdvance, layer=None)
-
Set the Advance Width (int) at given layer (int or str)
- setLSB(self, newLSB, layer=None)
-
Set the Left Side-bearing (int) at given layer (int or str)
- setLSBeq(self, equationStr, layer=None)
-
Set LSB metric equation on given layer
- setMark(self, mark_color, layer=None)
- setName(self, glyph_name)
- setRSB(self, newRSB, layer=None)
-
Set the Right Side-bearing (int) at given layer (int or str)
- setRSBeq(self, equationStr, layer=None)
-
Set RSB metric equation on given layer
- setTags(self, tagList, append=True)
- shapes(self, layer=None, extend=None)
-
Return all shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
- shapes_data(self, layer=None)
-
Return all flShapeData objects at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapeData]
- slant(self, deg, layer=None)
-
Slant outline at given layer. Args: deg (float): degrees of slant layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- tag(self, newTag)
- translate(self, dx, dy, layer=None)
-
Translate (shift) outline at given layer. Args: dx (float), dy (float): delta (shift) X, Y layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- update(self, fl=True, fg=False)
-
Updates the glyph and sends notification to the editor. Args: fl (bool): Update the flGlyph fg (bool): Update the fgGlyph
- updateObject(self, flObject, undoMessage='TypeRig', verbose=True)
-
Updates a flObject sends notification to the editor as well as undo/history item. Args: flObject (flGlyph, flLayer, flShape, flNode, flContour): Object to be update and set undo state undoMessage (string): Message to be added in undo/history list.
- version(self)
-
# - Basics -----------------------------------------------
Descriptors
- __dict__
-
dictionary for instance variables (if defined)
- __weakref__
-
list of weak references to the object (if defined)
- id
- index
- mark
- name
- package
- tags
- unicode
- unicodes
nodes
- typerig.proxy.objects.glyph.pGlyph.nodes = nodes(self, layer=None, extend=None, deep=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all nodes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer. extend (class): A class construct with extended functionality to be applied on every node. Returns: list[flNodes]
fg_nodes
- typerig.proxy.objects.glyph.pGlyph.fg_nodes = fg_nodes(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all FontGate nodes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgNodes]
contours
- typerig.proxy.objects.glyph.pGlyph.contours = contours(self, layer=None, deep=True, extend=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all contours at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flContours]
fg_contours
- typerig.proxy.objects.glyph.pGlyph.fg_contours = fg_contours(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all FontGate contours at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgContours]
layers
- typerig.proxy.objects.glyph.pGlyph.layers = layers(self) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all layers
fg_layers
- typerig.proxy.objects.glyph.pGlyph.fg_layers = fg_layers(self, asDict=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all FotnGate layers
layer
- typerig.proxy.objects.glyph.pGlyph.layer = layer(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Returns layer no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: flLayer
fg_layer
- typerig.proxy.objects.glyph.pGlyph.fg_layer = fg_layer(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Returns FontGate layer no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: fgLayer
shapes
- typerig.proxy.objects.glyph.pGlyph.shapes = shapes(self, layer=None, extend=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
getElementNames
- typerig.proxy.objects.glyph.pGlyph.getElementNames = getElementNames(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return names of elements references used in glyph.
dereference
- typerig.proxy.objects.glyph.pGlyph.dereference = dereference(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Remove all shape references but leave components. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
containers
- typerig.proxy.objects.glyph.pGlyph.containers = containers(self, layer=None, extend=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all complex shapes that contain other shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
decompose
- typerig.proxy.objects.glyph.pGlyph.decompose = decompose(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Decompose all complex shapes that contain other shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
addShape
- typerig.proxy.objects.glyph.pGlyph.addShape = addShape(self, shape, layer=None, clone=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Add a new shape at given layer. Args: shape (flShape): Shape to be added Returns: flShape
replaceShape
- typerig.proxy.objects.glyph.pGlyph.replaceShape = replaceShape(self, old_shape, new_shape, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Repalce a shape at given layer. Args: old_shape, new_shape (flShape): Shapes layer (str): Layer name Returns: None
removeShape
- typerig.proxy.objects.glyph.pGlyph.removeShape = removeShape(self, shape, layer=None, recursive=True) unbound typerig.proxy.objects.glyph.pGlyph method
-
Remove a new shape at given layer. Args: old_shape, new_shape (flShape): Shapes layer (str): Layer name recursive (bool): Returns: None
addShapeContainer
- typerig.proxy.objects.glyph.pGlyph.addShapeContainer = addShapeContainer(self, shapeList, layer=None, remove=True) unbound typerig.proxy.objects.glyph.pGlyph method
-
Add a new shape container* at given layer. A flShape containing all of the shapes given that could be transformed to Shape-group or shape-filter. Args: shapeList list(flShape): List if Shapes to be grouped. Returns: flShape
findShape
- typerig.proxy.objects.glyph.pGlyph.findShape = findShape(self, shapeName, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Finds shape by name on given layer Args: shapeName (str): Shape name layer (int or str): Layer index or name. If None returns ActiveLayer Returns: flShape or None
shapes_data
- typerig.proxy.objects.glyph.pGlyph.shapes_data = shapes_data(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all flShapeData objects at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapeData]
fg_shapes
- typerig.proxy.objects.glyph.pGlyph.fg_shapes = fg_shapes(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all FontGate shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgShapes]
elements
- typerig.proxy.objects.glyph.pGlyph.elements = elements(self, layer=None, extend=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all glyph elements in glyph
noncomplex
- typerig.proxy.objects.glyph.pGlyph.noncomplex = noncomplex(self, layer=None, extend=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all glyph shapes that are not glyph references or components
components
- typerig.proxy.objects.glyph.pGlyph.components = components(self, layer=None, extend=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all glyph components besides glyph.
getCompositionNames
- typerig.proxy.objects.glyph.pGlyph.getCompositionNames = getCompositionNames(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return name of glyph and the parts it is made of.
getCompositionDict
- typerig.proxy.objects.glyph.pGlyph.getCompositionDict = getCompositionDict(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return composition dict of a glyph. Elements!
addComponents
- typerig.proxy.objects.glyph.pGlyph.addComponents = addComponents(self, componentConfig, layer=None, useAnchors=True, colorize=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Adds a components to given glyph layer. Args: componentConfig (list(tuple(glyph_name (str), glyph_transform (QTransform), layer_pointer (str)))): List contianign component configuration. layer (int or str): Layer index or name. If None returns ActiveLayer useAnchors (bool): Compose using anchors colorize (bool): Flag new glyphs Returns: list(flShapes): List of components added
masters
- typerig.proxy.objects.glyph.pGlyph.masters = masters(self) unbound typerig.proxy.objects.glyph.pGlyph method
-
Returns all master layers.
masks
- typerig.proxy.objects.glyph.pGlyph.masks = masks(self) unbound typerig.proxy.objects.glyph.pGlyph method
-
Returns all mask layers.
services
- typerig.proxy.objects.glyph.pGlyph.services = services(self) unbound typerig.proxy.objects.glyph.pGlyph method
-
Returns all service layers.
addLayer
- typerig.proxy.objects.glyph.pGlyph.addLayer = addLayer(self, layer, toBack=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Adds a layer to glyph. Args: layer (flLayer or fgLayer) toBack (bool): Send layer to back Returns: None
removeLayer
- typerig.proxy.objects.glyph.pGlyph.removeLayer = removeLayer(self, layer) unbound typerig.proxy.objects.glyph.pGlyph method
-
Removes a layer from glyph. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
duplicateLayer
- typerig.proxy.objects.glyph.pGlyph.duplicateLayer = duplicateLayer(self, layer=None, newLayerName='New Layer', references=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Duplicates a layer with new name and adds it to glyph's layers. Args: layer (int or str): Layer index or name. If None returns ActiveLayer toBack(bool): send to back Returns: flLayer
copyLayer
- typerig.proxy.objects.glyph.pGlyph.copyLayer = copyLayer(self, srcLayerName, dstLayerName, options={'adv': True, 'anc': True, 'gui': True, 'lnk': True, 'lsb': True, 'out': True, 'ref': True, 'rsb': True}, addLayer=False, cleanDST=True, toBack=True) unbound typerig.proxy.objects.glyph.pGlyph method
-
Copies a layer within the glyph. Args: srcLayerName, dstLayerName (string): Source and destination layer names options (dict): Copy Options as follows {'out': Outline, 'gui': Guidelines, 'anc': Anchors, 'lsb': LSB, 'adv': Advance, 'rsb': RSB, 'lnk': Linked metrics, 'ref': References}, addLayer=False): addLayer (bool): Create a new layer cleanDST (bool): Clean destination layer toBack (bool): Add layer to back of the layer stack Returns: flLayer
isCompatible
- typerig.proxy.objects.glyph.pGlyph.isCompatible = isCompatible(self, strong=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Test if glyph is ready for interpolation - all master layers are compatible.
isMixedReference
- typerig.proxy.objects.glyph.pGlyph.isMixedReference = isMixedReference(self) unbound typerig.proxy.objects.glyph.pGlyph method
-
Test if glyph has mixed references - components on some layers and referenced shapes on others
reportLayerComp
- typerig.proxy.objects.glyph.pGlyph.reportLayerComp = reportLayerComp(self, strong=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Returns a layer compatibility report
update
- typerig.proxy.objects.glyph.pGlyph.update = update(self, fl=True, fg=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Updates the glyph and sends notification to the editor. Args: fl (bool): Update the flGlyph fg (bool): Update the fgGlyph
updateObject
- typerig.proxy.objects.glyph.pGlyph.updateObject = updateObject(self, flObject, undoMessage='TypeRig', verbose=True) unbound typerig.proxy.objects.glyph.pGlyph method
-
Updates a flObject sends notification to the editor as well as undo/history item. Args: flObject (flGlyph, flLayer, flShape, flNode, flContour): Object to be update and set undo state undoMessage (string): Message to be added in undo/history list.
selectedNodeIndices
- typerig.proxy.objects.glyph.pGlyph.selectedNodeIndices = selectedNodeIndices(self, filterOn=False, deep=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all indices of nodes selected at current layer. Args: filterOn (bool): Return only on-curve nodes Returns: list[int]
selected
- typerig.proxy.objects.glyph.pGlyph.selected = selected(self, filterOn=False, deep=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all selected nodes indexes at current layer. Args: filterOn (bool): Return only on-curve nodes Returns: list[int]
selectedNodes
- typerig.proxy.objects.glyph.pGlyph.selectedNodes = selectedNodes(self, layer=None, filterOn=False, extend=None, deep=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all selected nodes at given layer. Args: filterOn (bool): Return only on-curve nodes extend (class): A class construct with extended functionality to be applied on every node. Returns: list[flNode]
selectedAtContours
- typerig.proxy.objects.glyph.pGlyph.selectedAtContours = selectedAtContours(self, index=True, layer=None, filterOn=False, deep=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all selected nodes and the contours they rest upon at current layer. Args: index (bool): If True returns only indexes, False returns flContour, flNode filterOn (bool): Return only on-curve nodes Returns: list[tuple(int, int)]: [(contourID, nodeID)..()] or list[tuple(flContour, flNode)]
selectedAtShapes
- typerig.proxy.objects.glyph.pGlyph.selectedAtShapes = selectedAtShapes(self, index=True, filterOn=False, layer=None, deep=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all selected nodes and the shapes they belong at current layer. Args: index (bool): If True returns only indexes, False returns flShape, flNode filterOn (bool): Return only on-curve nodes Returns: list[tuple(int, int)]: [(shapeID, nodeID)..()] or list[tuple(flShape, flNode)] !TODO: Make it working with layers as selectedAtContours(). This is legacy mode so other scripts would work!
selectedShapeIndices
- typerig.proxy.objects.glyph.pGlyph.selectedShapeIndices = selectedShapeIndices(self, select_all=False, deep=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all indices of nodes selected at current layer. Args: select_all (bool): True all nodes on Shape should be selected. False any node will do. Returns: list[int]
selectedShapes
- typerig.proxy.objects.glyph.pGlyph.selectedShapes = selectedShapes(self, layer=None, select_all=False, deep=False, extend=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return all shapes that have a node selected.
selectedCoords
- typerig.proxy.objects.glyph.pGlyph.selectedCoords = selectedCoords(self, layer=None, filterOn=False, applyTransform=False) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return the coordinates of all selected nodes at the current layer or other. Args: layer (int or str): Layer index or name. If None returns ActiveLayer filterOn (bool): Return only on-curve nodes applyTransform (bool) : Gets local shape transformation matrix and applies it to the node coordinates Returns: list[QPointF]
selectedSegments
- typerig.proxy.objects.glyph.pGlyph.selectedSegments = selectedSegments(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Returns list of currently selected segments Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[CurveEx]
findNode
- typerig.proxy.objects.glyph.pGlyph.findNode = findNode(self, nodeName, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Find node by name/tag
findNodeCoords
- typerig.proxy.objects.glyph.pGlyph.findNodeCoords = findNodeCoords(self, nodeName, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Find node coordinates by name/tag
mapNodes2Times
- typerig.proxy.objects.glyph.pGlyph.mapNodes2Times = mapNodes2Times(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Create map of Nodes at contour times for every contour in given layer Returns: dict{Contour index (int) : dict{Contour Time (int): Node Index (int) }}
mapTimes2Nodes
- typerig.proxy.objects.glyph.pGlyph.mapTimes2Nodes = mapTimes2Nodes(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Create map of Contour times at node indexes for every contour in given layer Returns: dict{Contour index (int) : dict{Node Index (int) : Contour Time (int) }}
getSegment
- typerig.proxy.objects.glyph.pGlyph.getSegment = getSegment(self, cID, nID, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Returns contour segment of the node specified at given layer Args: cID (int): Contour index nID (int): Node of insertion index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: CurveEx
segments
- typerig.proxy.objects.glyph.pGlyph.segments = segments(self, cID, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Returns all contour segments at given layer Args: cID (int): Contour index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[CurveEx]
nodes4segments
- typerig.proxy.objects.glyph.pGlyph.nodes4segments = nodes4segments(self, cID, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Returns all contour segments and their corresponding nodes at given layer Args: cID (int): Contour index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: dict{time(int):(CurveEx, list[flNode]}
insertNodesAt
- typerig.proxy.objects.glyph.pGlyph.insertNodesAt = insertNodesAt(self, cID, nID, nodeList, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Inserts a list of nodes to specified contour, starting at given index all on layer specified. Args: cID (int): Contour index nID (int): Node of insertion index nodeList (list): List of flNode objects layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
removeNodes
- typerig.proxy.objects.glyph.pGlyph.removeNodes = removeNodes(self, cID, nodeList, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Removes a list of nodes from contour at layer specified. Args: cID (int): Contour index nodeList (list): List of flNode objects layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
insertNodeAt
- typerig.proxy.objects.glyph.pGlyph.insertNodeAt = insertNodeAt(self, cID, nID_time, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Inserts node in contour at specified layer Arg: cID (int): Contour Index nID_time (float): Node index + float time layer (int or str): Layer index or name. If None returns ActiveLayer !NOTE: FL6 treats contour insertions (as well as nodes) as float times along contour, so inserting a node at .5 t between nodes with indexes 3 and 4 will be 3 (index) + 0.5 (time) = 3.5
removeNodeAt
- typerig.proxy.objects.glyph.pGlyph.removeNodeAt = removeNodeAt(self, cID, nID, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Removes a node from contour at layer specified. Args: cID (int): Contour index nID (int): Index of Node to be removed layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
translate
- typerig.proxy.objects.glyph.pGlyph.translate = translate(self, dx, dy, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Translate (shift) outline at given layer. Args: dx (float), dy (float): delta (shift) X, Y layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
scale
- typerig.proxy.objects.glyph.pGlyph.scale = scale(self, sx, sy, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Scale outline at given layer. Args: sx (float), sy (float): delta (scaling) X, Y layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
slant
- typerig.proxy.objects.glyph.pGlyph.slant = slant(self, deg, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Slant outline at given layer. Args: deg (float): degrees of slant layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
rotate
- typerig.proxy.objects.glyph.pGlyph.rotate = rotate(self, deg, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Rotate outline at given layer. Args: deg (float): degrees of slant layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
blendShapes
- typerig.proxy.objects.glyph.pGlyph.blendShapes = blendShapes(self, shapeA, shapeB, blendTimes, outputFL=True, blendMode=0, engine='fg') unbound typerig.proxy.objects.glyph.pGlyph method
-
Blend two shapes at given times (anisotropic support). Args: shapeA (flShape), shapeB (flShape): Shapes to be interpolated blendTimes (int or float or tuple(float, float)): (int) for percent 0%-100% or (float) time for both X,Y or tuple(float,float) times for anisotropic blending outputFL (bool): Return blend native format or flShape (default) blendMode (int): ? engine (str): 'fg' for FontGate (in-build). Returns: Native (interpolation engine dependent) or flShape (default)
getLSB
- typerig.proxy.objects.glyph.pGlyph.getLSB = getLSB(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Get the Left Side-bearing at given layer (int or str)
getAdvance
- typerig.proxy.objects.glyph.pGlyph.getAdvance = getAdvance(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Get the Advance Width at given layer (int or str)
getRSB
- typerig.proxy.objects.glyph.pGlyph.getRSB = getRSB(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Get the Right Side-bearing at given layer (int or str)
getBounds
- typerig.proxy.objects.glyph.pGlyph.getBounds = getBounds(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Get Glyph's Boundig Box at given layer (int or str). Returns QRectF.
setLSB
- typerig.proxy.objects.glyph.pGlyph.setLSB = setLSB(self, newLSB, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Set the Left Side-bearing (int) at given layer (int or str)
setRSB
- typerig.proxy.objects.glyph.pGlyph.setRSB = setRSB(self, newRSB, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Set the Right Side-bearing (int) at given layer (int or str)
setAdvance
- typerig.proxy.objects.glyph.pGlyph.setAdvance = setAdvance(self, newAdvance, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Set the Advance Width (int) at given layer (int or str)
setLSBeq
- typerig.proxy.objects.glyph.pGlyph.setLSBeq = setLSBeq(self, equationStr, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Set LSB metric equation on given layer
setRSBeq
- typerig.proxy.objects.glyph.pGlyph.setRSBeq = setRSBeq(self, equationStr, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Set RSB metric equation on given layer
setADVeq
- typerig.proxy.objects.glyph.pGlyph.setADVeq = setADVeq(self, equationStr, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Set Advance width metric equation on given layer
getSBeq
- typerig.proxy.objects.glyph.pGlyph.getSBeq = getSBeq(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
GET LSB, RSB metric equations on given layer
fontMetricsInfo
- typerig.proxy.objects.glyph.pGlyph.fontMetricsInfo = fontMetricsInfo(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Returns Font(layer) metrics no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: FontMetrics (object)
anchors
- typerig.proxy.objects.glyph.pGlyph.anchors = anchors(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return list of anchors (list[flAnchor]) at given layer (int or str)
addAnchor
- typerig.proxy.objects.glyph.pGlyph.addAnchor = addAnchor(self, coordTuple, name, layer=None, isAnchor=True) unbound typerig.proxy.objects.glyph.pGlyph method
-
Adds named Anchor at given layer. Args: coordTuple (tuple(float,float)): Anchor coordinates X, Y name (str): Anchor name layer (int or str): Layer index or name. If None returns ActiveLayer isAnchor (bool): True creates a true flAnchor, False ? (flPinPoint) Returns: None
newAnchor
- typerig.proxy.objects.glyph.pGlyph.newAnchor = newAnchor(self, coordTuple, name, anchorType=1) unbound typerig.proxy.objects.glyph.pGlyph method
-
Not working
clearAnchors
- typerig.proxy.objects.glyph.pGlyph.clearAnchors = clearAnchors(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Remove all anchors at given layer (int or str)
findAnchor
- typerig.proxy.objects.glyph.pGlyph.findAnchor = findAnchor(self, anchorName, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Find anchor by name/tag
findAnchorCoords
- typerig.proxy.objects.glyph.pGlyph.findAnchorCoords = findAnchorCoords(self, anchorName, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Find anchor coordinates by name/tag
guidelines
- typerig.proxy.objects.glyph.pGlyph.guidelines = guidelines(self, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Return list of guidelines (list[flGuideline]) at given layer (int or str)
addGuideline
- typerig.proxy.objects.glyph.pGlyph.addGuideline = addGuideline(self, coordTuple, layer=None, angle=0, name='', tag='', color='darkMagenta', style='gsGlyphGuideline') unbound typerig.proxy.objects.glyph.pGlyph method
-
Adds named Guideline at given layer Args: coordTuple (tuple(float,float) or tuple(float,float,float,float)): Guideline coordinates X, Y and given angle or two node reference x1,y1 and x2,y2 name (str): Anchor name angle (float): Incline of the guideline layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
draw
- typerig.proxy.objects.glyph.pGlyph.draw = draw(self, pen, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Utilizes the Pen protocol
drawPoints
- typerig.proxy.objects.glyph.pGlyph.drawPoints = drawPoints(self, pen, layer=None) unbound typerig.proxy.objects.glyph.pGlyph method
-
Utilizes the PointPen protocol
eGlyph
typerig.proxy.objects.glyph.eGlyph = class eGlyph(pGlyph)
Extended representation of the Proxy Glyph, adding some advanced functionality Constructor: pGlyph() - default represents the current glyph and current font pGlyph(fgFont, fgGlyph)
- Method resolution order:
- eGlyph
- pGlyph
- __builtin__.object
Methods
- bindCompMetrics(self, layer=None, bindIndex=None)
-
Auto bind metrics to the base composite glyph or to specified shape index
- blendLayers(self, layerA, layerB, blendTimes, outputFL=True, blendMode=0, engine='fg')
-
Blend two layers at given times (anisotropic support). Args: layerA (flLayer), layerB (flLayer): Shapes to be interpolated blendTimes (int or float or tuple(float, float)): (int) for percent 0%-100% or (float) time for both X,Y or tuple(float,float) times for anisotropic blending outputFL (bool): Return blend native format or flShape (default) blendMode (int): ? engine (str): 'fg' for FontGate (in-build). Returns: flLayer
- breakContour(self, contourId, nodeId, layer=None, expand=0)
-
Split Contour at given node and layer. Extrapolate line endings if needed. Args: contourId (int): Contour Index nodeId (int): Node Index layer (int or str): Layer index or name, works with both expand (float): Will extrapolate the line endings at that given value Returns: flContour
- copyADVbyName(self, glyphName, layers=None, adjustPercent=100, adjustUnits=0)
-
Copy Advance width from another glyph specified by Glyph Name. Args: glyphName (str): Name of source glyph layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. adjustPercent (int): Adjust the copied metric by percent (100 default) adjustUnits (int): Adjust the copied metric by units (0 default) Return: None
- copyLSBbyName(self, glyphName, layers=None, order=0, adjustPercent=100, adjustUnits=0)
-
Copy LSB from another glyph specified by Glyph Name. Args: glyphName (str): Name of source glyph layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. order (bool or int): Use source LSB (0 False) or RSB (1 True). Flips the metric copied. adjustPercent (int): Adjust the copied metric by percent (100 default) adjustUnits (int): Adjust the copied metric by units (0 default) Return: None
- copyMetricsbyName(self, metricTriple=(None, None, None), layers=None, order=(0, 0, 0), adjustPercent=(100, 100, 100), adjustUnits=(0, 0, 0))
-
Copy LSB, RSB and Advance width from glyphs specified by Glyph Name. Args: metricTriple tuple(str): Names of source glyphs for (LSB, RSB, ADV) layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. order tuple(bool): Use source LSB (0 False) or RSB (1 True). Flips the metric copied. (LSB, RSB, 0) adjustPercent tuple(int): Adjust the copied metric by percent (100 default) - (LSB, RSB, ADV) adjustUnits tuple(int): Adjust the copied metric by units (0 default) - (LSB, RSB, ADV) Return: None
- copyRSBbyName(self, glyphName, layers=None, order=0, adjustPercent=100, adjustUnits=0)
-
Copy RSB from another glyph specified by Glyph Name. Args: glyphName (str): Name of source glyph layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. order (bool or int): Use source LSB (0 False) or RSB (1 True). Flips the metric copied. adjustPercent (int): Adjust the copied metric by percent (100 default) adjustUnits (int): Adjust the copied metric by units (0 default) Return: None
- dropAnchor(self, name, layer, coordTuple, alignTuple=(None, None), tolerance=5, italic=False)
-
Drop anchor at given layer Args: name (str): Anchor Name layer (int or str): Layer index or name, works with both coordTuple (int, int): New anchor coordinates or auto aligment offsets* alignTuple (str,str): New anchor aligment* tolerance (int): Outline feature auto detection tolerance* *Aligment rules: (width, height) - (None,None) - Uses coordinates given - width - (L) Left; (R) Right; (A) Auto Bottom with tolerance; (AT) Auto Top with tolerance; (C) Center; - height - (T) Top; (B) Bottom; (C) Center; Returns: None
- dropGuide(self, nodes=None, layers=None, name='*DropGuideline', tag='', color='darkMagenta', flip=(1, 1), style='gsGlyphGuideline')
-
Build guideline trough *any two* given points or the *first two of the current selection*. If *single point* is given will create a vertical guideline trough that point, with guideline inclined according to the font's Italic Angle. if process layers (pLayers) is None guideline will be created in all compatible layers, otherwise the bool control tuple (active_layer (True or False), masters (True or False), masks (True or False), services (True or False)) is used. If all are set to False only the active layer is used. Args: nodes (list(int)): List of node indexes layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. name (str): Name of the guideline to be build color (str): Color of the guideline according to QtCore colors style (str): Style of the guideline according to FontLab 6 Returns: None
- getAttachmentCenters(self, layer, tolerance=5, applyTransform=True, getAll=False)
-
Return X center of lowest, highest Y of [glyph] for [layer] within given [tolerance] Note: Determine diacritic to glyph attachment positions (for anchor placement)
- getNewBaseCoords(self, layer, adjustTuple, alignTuple, tolerance=5, italic=False, initPosTuple=(0.0, 0.0))
-
Calculate Anchor base position Args: layer (int or str): Layer index or name, works with both coordTuple (int/float, int/float): New anchor coordinates or auto aligment offsets* alignTuple (str,str): New anchor aligment* tolerance (int/float): Outline feature auto detection tolerance* initPosTuple (int/float, int/float): Itinital anchor position *Aligment rules: (width, height) - (None,None) - Uses coordinates given - width - (L) Left; (R) Right; (A) Auto Bottom with tolerance; (AT) Auto Top with tolerance; (C) Center; - height - (T) Top; (B) Bottom; (C) Center; Returns: x, y (int/float)
- lerpLayerFg(self, l0_Name, l1_Name)
- moveAnchor(self, name, layer, coordTuple=(0, 0), alignTuple=(None, None), tolerance=5, italic=False)
-
Move anchor at given layer Args: name (str): Anchor Name layer (int or str): Layer index or name, works with both coordTuple (int, int): New anchor coordinates or auto aligment offsets* alignTuple (str,str): New anchor aligment* tolerance (int): Outline feature auto detection tolerance* *Aligment rules: (width, height) - (None,None) - Uses coordinates given - width - (L) Left; (R) Right; (A) Auto Bottom with tolerance; (AT) Auto Top with tolerance; (C) Center; - height - (T) Top; (B) Bottom; (C) Center; Returns: None
- reorder_shapes(self, layer=None, mode=(0, 0))
-
Auto reorder shapes on given layer using criteria. Args: layer (int or str): Layer index or name, works with both mode (bool, bool): Mode of shape reordering/sorting by (X, Y) Returns: None
- setStart(self, layer=None, control=(0, 0))
- splitContour(self, scnPairs=None, layers=None, expand=0, close=False)
-
Split Contour at given node and combinations of compatible layers. Extrapolate line endings and close contour if needed. Args: scnPairs (list(tuple)): Shape-contour-node pairs for the selected nodes [(Shape Index, Contour Index, Node Index)..()] layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. expand (float): Will extrapolate the line endings at that given value close (bool): True = Close contour Return: None
- ungroup_all_shapes(self, layer=None, applyTransform=True)
-
Ungroup all shapes at given layer. Args: layer (int or str): Layer index or name, works with both applyTransform (bool): Apply transformation at shape. Returns: None
Methods from pGlyph
- __init__(self, *argv)
- __repr__(self)
- activeGuides(self)
- activeLayer(self)
- addAnchor(self, coordTuple, name, layer=None, isAnchor=True)
-
Adds named Anchor at given layer. Args: coordTuple (tuple(float,float)): Anchor coordinates X, Y name (str): Anchor name layer (int or str): Layer index or name. If None returns ActiveLayer isAnchor (bool): True creates a true flAnchor, False ? (flPinPoint) Returns: None
- addComponents(self, componentConfig, layer=None, useAnchors=True, colorize=False)
-
Adds a components to given glyph layer. Args: componentConfig (list(tuple(glyph_name (str), glyph_transform (QTransform), layer_pointer (str)))): List contianign component configuration. layer (int or str): Layer index or name. If None returns ActiveLayer useAnchors (bool): Compose using anchors colorize (bool): Flag new glyphs Returns: list(flShapes): List of components added
- addGuideline(self, coordTuple, layer=None, angle=0, name='', tag='', color='darkMagenta', style='gsGlyphGuideline')
-
Adds named Guideline at given layer Args: coordTuple (tuple(float,float) or tuple(float,float,float,float)): Guideline coordinates X, Y and given angle or two node reference x1,y1 and x2,y2 name (str): Anchor name angle (float): Incline of the guideline layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- addLayer(self, layer, toBack=False)
-
Adds a layer to glyph. Args: layer (flLayer or fgLayer) toBack (bool): Send layer to back Returns: None
- addShape(self, shape, layer=None, clone=False)
-
Add a new shape at given layer. Args: shape (flShape): Shape to be added Returns: flShape
- addShapeContainer(self, shapeList, layer=None, remove=True)
-
Add a new shape container* at given layer. A flShape containing all of the shapes given that could be transformed to Shape-group or shape-filter. Args: shapeList list(flShape): List if Shapes to be grouped. Returns: flShape
- anchors(self, layer=None)
-
Return list of anchors (list[flAnchor]) at given layer (int or str)
- blendShapes(self, shapeA, shapeB, blendTimes, outputFL=True, blendMode=0, engine='fg')
-
Blend two shapes at given times (anisotropic support). Args: shapeA (flShape), shapeB (flShape): Shapes to be interpolated blendTimes (int or float or tuple(float, float)): (int) for percent 0%-100% or (float) time for both X,Y or tuple(float,float) times for anisotropic blending outputFL (bool): Return blend native format or flShape (default) blendMode (int): ? engine (str): 'fg' for FontGate (in-build). Returns: Native (interpolation engine dependent) or flShape (default)
- clearAnchors(self, layer=None)
-
Remove all anchors at given layer (int or str)
- components(self, layer=None, extend=None)
-
Return all glyph components besides glyph.
- containers(self, layer=None, extend=None)
-
Return all complex shapes that contain other shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
- contours(self, layer=None, deep=True, extend=None)
-
Return all contours at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flContours]
- copyLayer(self, srcLayerName, dstLayerName, options={'adv': True, 'anc': True, 'gui': True, 'lnk': True, 'lsb': True, 'out': True, 'ref': True, 'rsb': True}, addLayer=False, cleanDST=True, toBack=True)
-
Copies a layer within the glyph. Args: srcLayerName, dstLayerName (string): Source and destination layer names options (dict): Copy Options as follows {'out': Outline, 'gui': Guidelines, 'anc': Anchors, 'lsb': LSB, 'adv': Advance, 'rsb': RSB, 'lnk': Linked metrics, 'ref': References}, addLayer=False): addLayer (bool): Create a new layer cleanDST (bool): Clean destination layer toBack (bool): Add layer to back of the layer stack Returns: flLayer
- decompose(self, layer=None)
-
Decompose all complex shapes that contain other shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- dereference(self, layer=None)
-
Remove all shape references but leave components. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
- draw(self, pen, layer=None)
-
Utilizes the Pen protocol
- drawPoints(self, pen, layer=None)
-
Utilizes the PointPen protocol
- duplicateLayer(self, layer=None, newLayerName='New Layer', references=False)
-
Duplicates a layer with new name and adds it to glyph's layers. Args: layer (int or str): Layer index or name. If None returns ActiveLayer toBack(bool): send to back Returns: flLayer
- elements(self, layer=None, extend=None)
-
Return all glyph elements in glyph
- fg_activeLayer(self)
- fg_contours(self, layer=None)
-
Return all FontGate contours at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgContours]
- fg_hasLayer(self, layerName)
- fg_layer(self, layer=None)
-
Returns FontGate layer no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: fgLayer
- fg_layers(self, asDict=False)
-
Return all FotnGate layers
- fg_nodes(self, layer=None)
-
Return all FontGate nodes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgNodes]
- fg_shapes(self, layer=None)
-
Return all FontGate shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[fgShapes]
- findAnchor(self, anchorName, layer=None)
-
Find anchor by name/tag
- findAnchorCoords(self, anchorName, layer=None)
-
Find anchor coordinates by name/tag
- findNode(self, nodeName, layer=None)
-
Find node by name/tag
- findNodeCoords(self, nodeName, layer=None)
-
Find node coordinates by name/tag
- findShape(self, shapeName, layer=None)
-
Finds shape by name on given layer Args: shapeName (str): Shape name layer (int or str): Layer index or name. If None returns ActiveLayer Returns: flShape or None
- fontMetricsInfo(self, layer=None)
-
Returns Font(layer) metrics no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: FontMetrics (object)
- getAdvance(self, layer=None)
-
Get the Advance Width at given layer (int or str)
- getBounds(self, layer=None)
-
Get Glyph's Boundig Box at given layer (int or str). Returns QRectF.
- getBuilders(self, layer=None, store=False)
- getCompositionDict(self, layer=None)
-
Return composition dict of a glyph. Elements!
- getCompositionNames(self, layer=None)
-
Return name of glyph and the parts it is made of.
- getElementNames(self, layer=None)
-
Return names of elements references used in glyph.
- getLSB(self, layer=None)
-
Get the Left Side-bearing at given layer (int or str)
- getRSB(self, layer=None)
-
Get the Right Side-bearing at given layer (int or str)
- getSBeq(self, layer=None)
-
GET LSB, RSB metric equations on given layer
- getSegment(self, cID, nID, layer=None)
-
Returns contour segment of the node specified at given layer Args: cID (int): Contour index nID (int): Node of insertion index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: CurveEx
- getTags(self)
-
# - Tags -----------------------------------------------
- guidelines(self, layer=None)
-
Return list of guidelines (list[flGuideline]) at given layer (int or str)
- hasLayer(self, layerName)
- insertNodeAt(self, cID, nID_time, layer=None)
-
Inserts node in contour at specified layer Arg: cID (int): Contour Index nID_time (float): Node index + float time layer (int or str): Layer index or name. If None returns ActiveLayer !NOTE: FL6 treats contour insertions (as well as nodes) as float times along contour, so inserting a node at .5 t between nodes with indexes 3 and 4 will be 3 (index) + 0.5 (time) = 3.5
- insertNodesAt(self, cID, nID, nodeList, layer=None)
-
Inserts a list of nodes to specified contour, starting at given index all on layer specified. Args: cID (int): Contour index nID (int): Node of insertion index nodeList (list): List of flNode objects layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- isCompatible(self, strong=False)
-
Test if glyph is ready for interpolation - all master layers are compatible.
- isMixedReference(self)
-
Test if glyph has mixed references - components on some layers and referenced shapes on others
- italicAngle(self)
- layer(self, layer=None)
-
Returns layer no matter the reference. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: flLayer
- layers(self)
-
Return all layers
- mLine(self)
- mapNodes2Times(self, layer=None)
-
Create map of Nodes at contour times for every contour in given layer Returns: dict{Contour index (int) : dict{Contour Time (int): Node Index (int) }}
- mapTimes2Nodes(self, layer=None)
-
Create map of Contour times at node indexes for every contour in given layer Returns: dict{Contour index (int) : dict{Node Index (int) : Contour Time (int) }}
- mask(self)
- masks(self)
-
Returns all mask layers.
- masters(self)
-
Returns all master layers.
- newAnchor(self, coordTuple, name, anchorType=1)
-
Not working
- nodes(self, layer=None, extend=None, deep=False)
-
Return all nodes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer. extend (class): A class construct with extended functionality to be applied on every node. Returns: list[flNodes]
- nodes4segments(self, cID, layer=None)
-
Returns all contour segments and their corresponding nodes at given layer Args: cID (int): Contour index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: dict{time(int):(CurveEx, list[flNode]}
- nodesForIndices(self, indices, layer=None, filterOn=False, extend=None, deep=False)
- noncomplex(self, layer=None, extend=None)
-
Return all glyph shapes that are not glyph references or components
- object(self)
- removeLayer(self, layer)
-
Removes a layer from glyph. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- removeNodeAt(self, cID, nID, layer=None)
-
Removes a node from contour at layer specified. Args: cID (int): Contour index nID (int): Index of Node to be removed layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- removeNodes(self, cID, nodeList, layer=None)
-
Removes a list of nodes from contour at layer specified. Args: cID (int): Contour index nodeList (list): List of flNode objects layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- removeShape(self, shape, layer=None, recursive=True)
-
Remove a new shape at given layer. Args: old_shape, new_shape (flShape): Shapes layer (str): Layer name recursive (bool): Returns: None
- replaceShape(self, old_shape, new_shape, layer=None)
-
Repalce a shape at given layer. Args: old_shape, new_shape (flShape): Shapes layer (str): Layer name Returns: None
- reportLayerComp(self, strong=False)
-
Returns a layer compatibility report
- rotate(self, deg, layer=None)
-
Rotate outline at given layer. Args: deg (float): degrees of slant layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- scale(self, sx, sy, layer=None)
-
Scale outline at given layer. Args: sx (float), sy (float): delta (scaling) X, Y layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- segments(self, cID, layer=None)
-
Returns all contour segments at given layer Args: cID (int): Contour index layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[CurveEx]
- selected(self, filterOn=False, deep=False)
-
Return all selected nodes indexes at current layer. Args: filterOn (bool): Return only on-curve nodes Returns: list[int]
- selectedAtContours(self, index=True, layer=None, filterOn=False, deep=False)
-
Return all selected nodes and the contours they rest upon at current layer. Args: index (bool): If True returns only indexes, False returns flContour, flNode filterOn (bool): Return only on-curve nodes Returns: list[tuple(int, int)]: [(contourID, nodeID)..()] or list[tuple(flContour, flNode)]
- selectedAtShapes(self, index=True, filterOn=False, layer=None, deep=False)
-
Return all selected nodes and the shapes they belong at current layer. Args: index (bool): If True returns only indexes, False returns flShape, flNode filterOn (bool): Return only on-curve nodes Returns: list[tuple(int, int)]: [(shapeID, nodeID)..()] or list[tuple(flShape, flNode)] !TODO: Make it working with layers as selectedAtContours(). This is legacy mode so other scripts would work!
- selectedContours(self, layer=None, allNodesSelected=False)
- selectedCoords(self, layer=None, filterOn=False, applyTransform=False)
-
Return the coordinates of all selected nodes at the current layer or other. Args: layer (int or str): Layer index or name. If None returns ActiveLayer filterOn (bool): Return only on-curve nodes applyTransform (bool) : Gets local shape transformation matrix and applies it to the node coordinates Returns: list[QPointF]
- selectedNodeIndices(self, filterOn=False, deep=False)
-
Return all indices of nodes selected at current layer. Args: filterOn (bool): Return only on-curve nodes Returns: list[int]
- selectedNodes(self, layer=None, filterOn=False, extend=None, deep=False)
-
Return all selected nodes at given layer. Args: filterOn (bool): Return only on-curve nodes extend (class): A class construct with extended functionality to be applied on every node. Returns: list[flNode]
- selectedNodesOnCanvas(self, filterOn=False)
-
# - Glyph Selection -----------------------------------------------
- selectedSegments(self, layer=None)
-
Returns list of currently selected segments Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[CurveEx]
- selectedShapeIndices(self, select_all=False, deep=False)
-
Return all indices of nodes selected at current layer. Args: select_all (bool): True all nodes on Shape should be selected. False any node will do. Returns: list[int]
- selectedShapes(self, layer=None, select_all=False, deep=False, extend=None)
-
Return all shapes that have a node selected.
- services(self)
-
Returns all service layers.
- setADVeq(self, equationStr, layer=None)
-
Set Advance width metric equation on given layer
- setAdvance(self, newAdvance, layer=None)
-
Set the Advance Width (int) at given layer (int or str)
- setLSB(self, newLSB, layer=None)
-
Set the Left Side-bearing (int) at given layer (int or str)
- setLSBeq(self, equationStr, layer=None)
-
Set LSB metric equation on given layer
- setMark(self, mark_color, layer=None)
- setName(self, glyph_name)
- setRSB(self, newRSB, layer=None)
-
Set the Right Side-bearing (int) at given layer (int or str)
- setRSBeq(self, equationStr, layer=None)
-
Set RSB metric equation on given layer
- setTags(self, tagList, append=True)
- shapes(self, layer=None, extend=None)
-
Return all shapes at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapes]
- shapes_data(self, layer=None)
-
Return all flShapeData objects at given layer. Args: layer (int or str): Layer index or name. If None returns ActiveLayer Returns: list[flShapeData]
- slant(self, deg, layer=None)
-
Slant outline at given layer. Args: deg (float): degrees of slant layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- tag(self, newTag)
- translate(self, dx, dy, layer=None)
-
Translate (shift) outline at given layer. Args: dx (float), dy (float): delta (shift) X, Y layer (int or str): Layer index or name. If None returns ActiveLayer Returns: None
- update(self, fl=True, fg=False)
-
Updates the glyph and sends notification to the editor. Args: fl (bool): Update the flGlyph fg (bool): Update the fgGlyph
- updateObject(self, flObject, undoMessage='TypeRig', verbose=True)
-
Updates a flObject sends notification to the editor as well as undo/history item. Args: flObject (flGlyph, flLayer, flShape, flNode, flContour): Object to be update and set undo state undoMessage (string): Message to be added in undo/history list.
- version(self)
-
# - Basics -----------------------------------------------
Descriptors from pGlyph
- __dict__
-
dictionary for instance variables (if defined)
- __weakref__
-
list of weak references to the object (if defined)
- id
- index
- mark
- name
- package
- tags
- unicode
- unicodes
breakContour
- typerig.proxy.objects.glyph.eGlyph.breakContour = breakContour(self, contourId, nodeId, layer=None, expand=0) unbound typerig.proxy.objects.glyph.eGlyph method
-
Split Contour at given node and layer. Extrapolate line endings if needed. Args: contourId (int): Contour Index nodeId (int): Node Index layer (int or str): Layer index or name, works with both expand (float): Will extrapolate the line endings at that given value Returns: flContour
splitContour
- typerig.proxy.objects.glyph.eGlyph.splitContour = splitContour(self, scnPairs=None, layers=None, expand=0, close=False) unbound typerig.proxy.objects.glyph.eGlyph method
-
Split Contour at given node and combinations of compatible layers. Extrapolate line endings and close contour if needed. Args: scnPairs (list(tuple)): Shape-contour-node pairs for the selected nodes [(Shape Index, Contour Index, Node Index)..()] layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. expand (float): Will extrapolate the line endings at that given value close (bool): True = Close contour Return: None
dropGuide
- typerig.proxy.objects.glyph.eGlyph.dropGuide = dropGuide(self, nodes=None, layers=None, name='*DropGuideline', tag='', color='darkMagenta', flip=(1, 1), style='gsGlyphGuideline') unbound typerig.proxy.objects.glyph.eGlyph method
-
Build guideline trough *any two* given points or the *first two of the current selection*. If *single point* is given will create a vertical guideline trough that point, with guideline inclined according to the font's Italic Angle. if process layers (pLayers) is None guideline will be created in all compatible layers, otherwise the bool control tuple (active_layer (True or False), masters (True or False), masks (True or False), services (True or False)) is used. If all are set to False only the active layer is used. Args: nodes (list(int)): List of node indexes layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. name (str): Name of the guideline to be build color (str): Color of the guideline according to QtCore colors style (str): Style of the guideline according to FontLab 6 Returns: None
copyLSBbyName
- typerig.proxy.objects.glyph.eGlyph.copyLSBbyName = copyLSBbyName(self, glyphName, layers=None, order=0, adjustPercent=100, adjustUnits=0) unbound typerig.proxy.objects.glyph.eGlyph method
-
Copy LSB from another glyph specified by Glyph Name. Args: glyphName (str): Name of source glyph layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. order (bool or int): Use source LSB (0 False) or RSB (1 True). Flips the metric copied. adjustPercent (int): Adjust the copied metric by percent (100 default) adjustUnits (int): Adjust the copied metric by units (0 default) Return: None
copyRSBbyName
- typerig.proxy.objects.glyph.eGlyph.copyRSBbyName = copyRSBbyName(self, glyphName, layers=None, order=0, adjustPercent=100, adjustUnits=0) unbound typerig.proxy.objects.glyph.eGlyph method
-
Copy RSB from another glyph specified by Glyph Name. Args: glyphName (str): Name of source glyph layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. order (bool or int): Use source LSB (0 False) or RSB (1 True). Flips the metric copied. adjustPercent (int): Adjust the copied metric by percent (100 default) adjustUnits (int): Adjust the copied metric by units (0 default) Return: None
copyADVbyName
- typerig.proxy.objects.glyph.eGlyph.copyADVbyName = copyADVbyName(self, glyphName, layers=None, adjustPercent=100, adjustUnits=0) unbound typerig.proxy.objects.glyph.eGlyph method
-
Copy Advance width from another glyph specified by Glyph Name. Args: glyphName (str): Name of source glyph layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. adjustPercent (int): Adjust the copied metric by percent (100 default) adjustUnits (int): Adjust the copied metric by units (0 default) Return: None
copyMetricsbyName
- typerig.proxy.objects.glyph.eGlyph.copyMetricsbyName = copyMetricsbyName(self, metricTriple=(None, None, None), layers=None, order=(0, 0, 0), adjustPercent=(100, 100, 100), adjustUnits=(0, 0, 0)) unbound typerig.proxy.objects.glyph.eGlyph method
-
Copy LSB, RSB and Advance width from glyphs specified by Glyph Name. Args: metricTriple tuple(str): Names of source glyphs for (LSB, RSB, ADV) layers tuple(bool): Bool control tuple(active_layer, masters, masks, services). Note If all are set to False only the active layer is used. order tuple(bool): Use source LSB (0 False) or RSB (1 True). Flips the metric copied. (LSB, RSB, 0) adjustPercent tuple(int): Adjust the copied metric by percent (100 default) - (LSB, RSB, ADV) adjustUnits tuple(int): Adjust the copied metric by units (0 default) - (LSB, RSB, ADV) Return: None
bindCompMetrics
- typerig.proxy.objects.glyph.eGlyph.bindCompMetrics = bindCompMetrics(self, layer=None, bindIndex=None) unbound typerig.proxy.objects.glyph.eGlyph method
-
Auto bind metrics to the base composite glyph or to specified shape index
blendLayers
- typerig.proxy.objects.glyph.eGlyph.blendLayers = blendLayers(self, layerA, layerB, blendTimes, outputFL=True, blendMode=0, engine='fg') unbound typerig.proxy.objects.glyph.eGlyph method
-
Blend two layers at given times (anisotropic support). Args: layerA (flLayer), layerB (flLayer): Shapes to be interpolated blendTimes (int or float or tuple(float, float)): (int) for percent 0%-100% or (float) time for both X,Y or tuple(float,float) times for anisotropic blending outputFL (bool): Return blend native format or flShape (default) blendMode (int): ? engine (str): 'fg' for FontGate (in-build). Returns: flLayer
getAttachmentCenters
- typerig.proxy.objects.glyph.eGlyph.getAttachmentCenters = getAttachmentCenters(self, layer, tolerance=5, applyTransform=True, getAll=False) unbound typerig.proxy.objects.glyph.eGlyph method
-
Return X center of lowest, highest Y of [glyph] for [layer] within given [tolerance] Note: Determine diacritic to glyph attachment positions (for anchor placement)
getNewBaseCoords
- typerig.proxy.objects.glyph.eGlyph.getNewBaseCoords = getNewBaseCoords(self, layer, adjustTuple, alignTuple, tolerance=5, italic=False, initPosTuple=(0.0, 0.0)) unbound typerig.proxy.objects.glyph.eGlyph method
-
Calculate Anchor base position Args: layer (int or str): Layer index or name, works with both coordTuple (int/float, int/float): New anchor coordinates or auto aligment offsets* alignTuple (str,str): New anchor aligment* tolerance (int/float): Outline feature auto detection tolerance* initPosTuple (int/float, int/float): Itinital anchor position *Aligment rules: (width, height) - (None,None) - Uses coordinates given - width - (L) Left; (R) Right; (A) Auto Bottom with tolerance; (AT) Auto Top with tolerance; (C) Center; - height - (T) Top; (B) Bottom; (C) Center; Returns: x, y (int/float)
dropAnchor
- typerig.proxy.objects.glyph.eGlyph.dropAnchor = dropAnchor(self, name, layer, coordTuple, alignTuple=(None, None), tolerance=5, italic=False) unbound typerig.proxy.objects.glyph.eGlyph method
-
Drop anchor at given layer Args: name (str): Anchor Name layer (int or str): Layer index or name, works with both coordTuple (int, int): New anchor coordinates or auto aligment offsets* alignTuple (str,str): New anchor aligment* tolerance (int): Outline feature auto detection tolerance* *Aligment rules: (width, height) - (None,None) - Uses coordinates given - width - (L) Left; (R) Right; (A) Auto Bottom with tolerance; (AT) Auto Top with tolerance; (C) Center; - height - (T) Top; (B) Bottom; (C) Center; Returns: None
moveAnchor
- typerig.proxy.objects.glyph.eGlyph.moveAnchor = moveAnchor(self, name, layer, coordTuple=(0, 0), alignTuple=(None, None), tolerance=5, italic=False) unbound typerig.proxy.objects.glyph.eGlyph method
-
Move anchor at given layer Args: name (str): Anchor Name layer (int or str): Layer index or name, works with both coordTuple (int, int): New anchor coordinates or auto aligment offsets* alignTuple (str,str): New anchor aligment* tolerance (int): Outline feature auto detection tolerance* *Aligment rules: (width, height) - (None,None) - Uses coordinates given - width - (L) Left; (R) Right; (A) Auto Bottom with tolerance; (AT) Auto Top with tolerance; (C) Center; - height - (T) Top; (B) Bottom; (C) Center; Returns: None
reorder_shapes
- typerig.proxy.objects.glyph.eGlyph.reorder_shapes = reorder_shapes(self, layer=None, mode=(0, 0)) unbound typerig.proxy.objects.glyph.eGlyph method
-
Auto reorder shapes on given layer using criteria. Args: layer (int or str): Layer index or name, works with both mode (bool, bool): Mode of shape reordering/sorting by (X, Y) Returns: None
ungroup_all_shapes
- typerig.proxy.objects.glyph.eGlyph.ungroup_all_shapes = ungroup_all_shapes(self, layer=None, applyTransform=True) unbound typerig.proxy.objects.glyph.eGlyph method
-
Ungroup all shapes at given layer. Args: layer (int or str): Layer index or name, works with both applyTransform (bool): Apply transformation at shape. Returns: None