typerig.proxy.objects.font

typerig.proxy.objects.font (version 0.27.4)

# MODULE: Typerig / Proxy / Font (Objects)
# -----------------------------------------------------------
# (C) Vassil Kateliev, 2017-2020        (http://www.kateliev.com)
# (C) Karandash Type Foundry            (http://www.karandash.eu)
#------------------------------------------------------------
# www.typerig.com

Modules

  • fontgate
  • fontlab
  • json
  • FL
  • math
  • PythonQt
  • fontTools.pens.statisticsPen

Classes

class eFont(pFont)

Proxy Font extension, packing some useful tools.

Constructor:
        eFont() - default represents the current glyph and current font
        eFont(fgFont)

Method resolution order:
eFont
pFont
builtin.object

Methods

copyZones(self, font)



Methods from pFont

init(self, font=None)



repr(self)



addGlyph(self, glyph)

Adds a Glyph (fgGlyph or flGlyph) to font

addGlyphList(self, glyphList)

Adds a List of Glyphs [fgGlyph or flGlyph] to font

addGuideline(self, flGuide)

Adds a guideline (flGuide) to font guidelines

addOTgroup(self, groupName, glyphList)



addZone(self, position, width, layer=None)

A very dirty way to add a new Zone to Font

add_kerning_group(self, key, glyphNameList, type, layer=None)

Adds a new group to fonts kerning groups.
Args:
        key (string): Group name
        glyphNameList (list(string)): List of glyph names
        type (string): Kern group types: L - Left group (1st), R - Right group (2nd), B - Both (1st and 2nd)
        layer (None, Int, String)

Returns:
        None

alternates(self, namesOnly=False)

Returns all alternate characters (list[fgGlyph])

axes(self)

# - Axes and MM ----------------------------------------------------

clearFeatures(self)



clearGuidelines(self)

Removes all font guidelines

delFeature(self, tag)



delGuideline(self, flGuide)

Removes a guideline (flGuide) from font guidelines

dict_to_kerning_groups(self, groupDict, layer=None)



duplicateGlyph(self, src_name, dst_name, dst_unicode=None, options={'adv': True, 'anc': True, 'flg': True, 'gui': True, 'lnk': True, 'lsb': True, 'out': True, 'ref': True, 'rsb': True, 'tag': True})

Duplicates a glyph and adds it to the font
Args:
        src_name, dst_name (str): Source and destination names
        dst_unicode (int): Unicode int of the new glyph
        references (bool): Keep existing element references (True) or decompose (False)
Returns:
        pGlyph

figures(self, namesOnly=False)

Returns all uppercase characters (list[fgGlyph])

findShape(self, shapeName, master=None)

Search for element (flShape) in font and return it

fl_kerning_groups(self, layer=None)



fl_kerning_groups_to_dict(self, layer=None)



fontMetrics(self)

Returns pFontMetrics Object with getter/setter functionality

fontMetricsInfo(self, layer)

Returns Font(layer) metrics no matter the reference.
Args:
        layer (int or str): Layer index or name. If None returns ActiveLayer
Returns:
        FontMetrics (object)

getFeaPrefix(self)



getFeature(self, tag)



getFeatureTags(self)



getFeatures(self)

# - OpenType and features -------------------------------------

getGlyphNameDict(self)



getGlyphNames(self)

# - Charset -----------------------------------------------
# -- Return Names

getGlyphUnicodeDict(self, encoding='utf-8')



getItalicAngle(self)

# - Font metrics -----------------------------------------------

getOTgroups(self)



getSelectedIndices(self)

# Functions ---------------------------------------------------
# - Font Basics -----------------------------------------------

getZones(self, layer=None, HintingDataType=0)

Returns font alignment (blue) zones (list[flGuideline]). Note: HintingDataType = {'HintingPS': 0, 'HintingTT': 1}

glyph(self, glyph, extend=None)

Return TypeRig proxy glyph object (pGlyph) by index (int) or name (str).

glyphs(self, indexList=[], extend=None)

Return list of FontGate glyph objects (list[fgGlyph]).

guidelines(self, hostInf=False, fontgate=False)

Return font guidelines
Args:
        hostInf (bool): If True Return flHostInfo guidelines host objects
        fontgate (bool): If True return FontGate font guideline objects
Returns
        list[flGuideline] or list[fgGuideline]

hasFeature(self, tag)



hasGlyph(self, glyphName)



hasMaster(self, layerName)



hinting(self)

Returns fonts hinting

instances(self)



kerning(self, layer=None)

Return the fonts kerning object (fgKerning) no matter the reference.

kerning_dump(self, layer=None, mark_groups='@', pairs_only=False)

Dump layer kerning to simple tuples.
Args:
        layer (None, Int, String): Extract kerning data for layer specified;
        mark_groups (String): Mark group kerning with special symbol
        pairs_only (Bool): Export pairs without value

Returns:
        pairs_only is False:    list(tuple(tuple(str(First), str(Second))), Int(Value)))
        pairs_only is True:             list(tuple(str(First), str(Second)))

kerning_groups(self, layer=None)

Return the fonts kerning groups object (fgKerningGroups) no matter the reference.

kerning_groups_to_dict(self, layer=None, byPosition=False, sortUnicode=False)

Return dictionary containing kerning groups 
Args:
        layer (None, Int, String): Extract kerning data for layer specified;
        byPosition (bool): Dictionary by class kerning positions - KernLeft(1st), KernRight(2nd) or KernBothSide(Both);
        sortUnicode (bool): Sort members of kern group according to their Unicode value.

Returns:
        dict

kerning_to_list(self, layer=None)



ligatures(self, namesOnly=False)

Returns all ligature characters (list[fgGlyph])

lowercase(self, namesOnly=False)

Returns all uppercase characters (list[fgGlyph])

masters(self)



newGlyph(self, glyph_name, layers=[], unicode_int=None)

Creates new glyph and adds it to the font
Args:
        glyph_name (str): New glyph name
        layers (list(str) or list(flLayer)): List of layers to be added to the new glyph
        unicode_int (int): Unicode int of the new glyph
Returns:
        pGlyph

newGlyphFromRecipe(self, glyph_name, recipe, layers=[], unicode_int=None, rtl=False)

Generate new glyph (glyph_name) using String Recipe (recipe)
Args:
        glyph_name (str): New glyph name
        recipe (str): Glyph composition recipe using OLD Fontlab syntax (ex. A+acute=Aacute)
        layers (list(str)): List of layer names to be added
        unicode_int (int): Unicode int of the new glyph
        rtl (bool): Right to left
Returns:
        pGlyph

newKernPair(self, glyphLeft, glyphRight, modeLeft, modeRight)



newOTgroup(self, groupName, glyphList)



pGlyphs(self, fgGlyphList=[])

Return list of TypeRig proxy Glyph objects glyph objects (list[pGlyph]).

remove_kerning_group(self, key, layer=None)

Remove a group from fonts kerning groups at given layer.

rename_kerning_group(self, oldkey, newkey, layer=None)

Rename a group in fonts kerning groups at given layer.

reset_kerning_groups(self, layer=None)



selectGlyphs(self, glyphNameList)



selectedGlyphs(self, extend=None)

Return TypeRig proxy glyph object for each selected glyph

selected_pGlyphs(self)

Return TypeRig proxy glyph object for each selected glyph

setFeaPrefix(self, feaString)



setFeature(self, tag, feaString)



setSelectedIndices(self, indList)



setZones(self, fontZones, layer=None)



symbol(self, gID)

Return fgSymbol by glyph index (int)

symbols(self, namesOnly=False)

Returns all uppercase characters (list[fgGlyph])

unselectAll(self)



update(self)



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.

uppercase(self, namesOnly=False)

Returns all uppercase characters (list[fgGlyph])

zonesFromTuples(self, zoneTupleList, layer=None, forceNames=False)



zonesToTuples(self, layer=None, HintingDataType=0)



Descriptors from pFont

OTfullName
PSfullName
dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

familyName
info
italic_angle
name
path

class jFont(builtin.object)

Proxy VFJ Font (Fontlab JSON Font format)

Constructor:
        jFont(): Construct an empty jFont
        jFont(vfj_file_path): Load VFJ form vfj_file_path (STR)
        jFont(pFont): Load VFJ from pFont.path. VFJ Font has to be in the same path as the VFC

Methods:
        .data(): Access to VFJ font
        .load(file_path): Load VFJ font from path
        .save_as(file_path): Save VFJ font to path
        .save(): Save VFJ (overwrite)

Methods

init(self, source=None)



load(self, file_path)



save(self)



save_as(self, file_path)



Descriptors

dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

class pDesignSpace(builtin.object)



Methods

init(self, parent)



repr(self)



Descriptors

dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

axes
axes_dict
axes_list

class pFont(builtin.object)

A Proxy Font representation of Fonlab fgFont and flPackage.

Constructor:
        pFont(None) : Default represents the current glyph and current font
        pFont(fgFont) : Creates a pFont object from FontGate fgFont object
        pFont(file_path) : Loats a existing font form file_path (str) and creates a pFont object

Methods

init(self, font=None)



repr(self)



addGlyph(self, glyph)

Adds a Glyph (fgGlyph or flGlyph) to font

addGlyphList(self, glyphList)

Adds a List of Glyphs [fgGlyph or flGlyph] to font

addGuideline(self, flGuide)

Adds a guideline (flGuide) to font guidelines

addOTgroup(self, groupName, glyphList)



addZone(self, position, width, layer=None)

A very dirty way to add a new Zone to Font

add_kerning_group(self, key, glyphNameList, type, layer=None)

Adds a new group to fonts kerning groups.
Args:
        key (string): Group name
        glyphNameList (list(string)): List of glyph names
        type (string): Kern group types: L - Left group (1st), R - Right group (2nd), B - Both (1st and 2nd)
        layer (None, Int, String)

Returns:
        None

alternates(self, namesOnly=False)

Returns all alternate characters (list[fgGlyph])

axes(self)

# - Axes and MM ----------------------------------------------------

clearFeatures(self)



clearGuidelines(self)

Removes all font guidelines

delFeature(self, tag)



delGuideline(self, flGuide)

Removes a guideline (flGuide) from font guidelines

dict_to_kerning_groups(self, groupDict, layer=None)



duplicateGlyph(self, src_name, dst_name, dst_unicode=None, options={'adv': True, 'anc': True, 'flg': True, 'gui': True, 'lnk': True, 'lsb': True, 'out': True, 'ref': True, 'rsb': True, 'tag': True})

Duplicates a glyph and adds it to the font
Args:
        src_name, dst_name (str): Source and destination names
        dst_unicode (int): Unicode int of the new glyph
        references (bool): Keep existing element references (True) or decompose (False)
Returns:
        pGlyph

figures(self, namesOnly=False)

Returns all uppercase characters (list[fgGlyph])

findShape(self, shapeName, master=None)

Search for element (flShape) in font and return it

fl_kerning_groups(self, layer=None)



fl_kerning_groups_to_dict(self, layer=None)



fontMetrics(self)

Returns pFontMetrics Object with getter/setter functionality

fontMetricsInfo(self, layer)

Returns Font(layer) metrics no matter the reference.
Args:
        layer (int or str): Layer index or name. If None returns ActiveLayer
Returns:
        FontMetrics (object)

getFeaPrefix(self)



getFeature(self, tag)



getFeatureTags(self)



getFeatures(self)

# - OpenType and features -------------------------------------

getGlyphNameDict(self)



getGlyphNames(self)

# - Charset -----------------------------------------------
# -- Return Names

getGlyphUnicodeDict(self, encoding='utf-8')



getItalicAngle(self)

# - Font metrics -----------------------------------------------

getOTgroups(self)



getSelectedIndices(self)

# Functions ---------------------------------------------------
# - Font Basics -----------------------------------------------

getZones(self, layer=None, HintingDataType=0)

Returns font alignment (blue) zones (list[flGuideline]). Note: HintingDataType = {'HintingPS': 0, 'HintingTT': 1}

glyph(self, glyph, extend=None)

Return TypeRig proxy glyph object (pGlyph) by index (int) or name (str).

glyphs(self, indexList=[], extend=None)

Return list of FontGate glyph objects (list[fgGlyph]).

guidelines(self, hostInf=False, fontgate=False)

Return font guidelines
Args:
        hostInf (bool): If True Return flHostInfo guidelines host objects
        fontgate (bool): If True return FontGate font guideline objects
Returns
        list[flGuideline] or list[fgGuideline]

hasFeature(self, tag)



hasGlyph(self, glyphName)



hasMaster(self, layerName)



hinting(self)

Returns fonts hinting

instances(self)



kerning(self, layer=None)

Return the fonts kerning object (fgKerning) no matter the reference.

kerning_dump(self, layer=None, mark_groups='@', pairs_only=False)

Dump layer kerning to simple tuples.
Args:
        layer (None, Int, String): Extract kerning data for layer specified;
        mark_groups (String): Mark group kerning with special symbol
        pairs_only (Bool): Export pairs without value

Returns:
        pairs_only is False:    list(tuple(tuple(str(First), str(Second))), Int(Value)))
        pairs_only is True:             list(tuple(str(First), str(Second)))

kerning_groups(self, layer=None)

Return the fonts kerning groups object (fgKerningGroups) no matter the reference.

kerning_groups_to_dict(self, layer=None, byPosition=False, sortUnicode=False)

Return dictionary containing kerning groups 
Args:
        layer (None, Int, String): Extract kerning data for layer specified;
        byPosition (bool): Dictionary by class kerning positions - KernLeft(1st), KernRight(2nd) or KernBothSide(Both);
        sortUnicode (bool): Sort members of kern group according to their Unicode value.

Returns:
        dict

kerning_to_list(self, layer=None)



ligatures(self, namesOnly=False)

Returns all ligature characters (list[fgGlyph])

lowercase(self, namesOnly=False)

Returns all uppercase characters (list[fgGlyph])

masters(self)



newGlyph(self, glyph_name, layers=[], unicode_int=None)

Creates new glyph and adds it to the font
Args:
        glyph_name (str): New glyph name
        layers (list(str) or list(flLayer)): List of layers to be added to the new glyph
        unicode_int (int): Unicode int of the new glyph
Returns:
        pGlyph

newGlyphFromRecipe(self, glyph_name, recipe, layers=[], unicode_int=None, rtl=False)

Generate new glyph (glyph_name) using String Recipe (recipe)
Args:
        glyph_name (str): New glyph name
        recipe (str): Glyph composition recipe using OLD Fontlab syntax (ex. A+acute=Aacute)
        layers (list(str)): List of layer names to be added
        unicode_int (int): Unicode int of the new glyph
        rtl (bool): Right to left
Returns:
        pGlyph

newKernPair(self, glyphLeft, glyphRight, modeLeft, modeRight)



newOTgroup(self, groupName, glyphList)



pGlyphs(self, fgGlyphList=[])

Return list of TypeRig proxy Glyph objects glyph objects (list[pGlyph]).

remove_kerning_group(self, key, layer=None)

Remove a group from fonts kerning groups at given layer.

rename_kerning_group(self, oldkey, newkey, layer=None)

Rename a group in fonts kerning groups at given layer.

reset_kerning_groups(self, layer=None)



selectGlyphs(self, glyphNameList)



selectedGlyphs(self, extend=None)

Return TypeRig proxy glyph object for each selected glyph

selected_pGlyphs(self)

Return TypeRig proxy glyph object for each selected glyph

setFeaPrefix(self, feaString)



setFeature(self, tag, feaString)



setSelectedIndices(self, indList)



setZones(self, fontZones, layer=None)



symbol(self, gID)

Return fgSymbol by glyph index (int)

symbols(self, namesOnly=False)

Returns all uppercase characters (list[fgGlyph])

unselectAll(self)



update(self)



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.

uppercase(self, namesOnly=False)

Returns all uppercase characters (list[fgGlyph])

zonesFromTuples(self, zoneTupleList, layer=None, forceNames=False)



zonesToTuples(self, layer=None, HintingDataType=0)



Descriptors

OTfullName
PSfullName
dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

familyName
info
italic_angle
name
path

class pFontMetrics(builtin.object)

An Abstract Font Metrics getter/setter of a flPackage.

Constructor:
        pFontMetrics() - default represents the current glyph and current font
        pFontMetrics(flPackage)

Methods

init(self, font)



asDict(self, layer=None)

# - Export & Import

fromDict(self, metricDict, layer=None)



getAscender(self, layer=None)

# - Getters

getCapsHeight(self, layer=None)



getCaretOffset(self, layer=None)



getDescender(self, layer=None)



getItalicAngle(self, layer=None)



getLineGap(self, layer=None)



getXHeight(self, layer=None)



setAscender(self, value, layer=None)

# - Setters

setCapsHeight(self, value, layer=None)



setCaretOffset(self, value, layer=None)



setDescender(self, value, layer=None)



setItalicAngle(self, value, layer=None)



setLineGap(self, value, layer=None)



setXHeight(self, value, layer=None)



Descriptors

dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

class pMaster(typerig.core.objects.collection.treeDict)



Methods

init(self, *args, **kwargs)



repr(self)



Methods from typerig.core.objects.collection.treeDict

getattribute(self, name)



setattr(self, name, value)



Descriptors from typerig.core.objects.collection.treeDict

dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

Methods from collections.defaultdict

copy(...)

D.copy() -> a shallow copy of D.

missing(...)

__missing__(key) # Called by __getitem__ for missing key; pseudo-code:
if self.default_factory is None: raise KeyError((key,))
self[key] = value = self.default_factory()
return value

reduce(...)

Return state information for pickling.

copy(...)

D.copy() -> a shallow copy of D.

Descriptors from collections.defaultdict

default_factory

Factory for default value called by __missing__().

Methods from builtin.dict

cmp(...)

x.__cmp__(y) <==> cmp(x,y)

contains(...)

D.__contains__(k) -> True if D has a key k, else False

delitem(...)

x.__delitem__(y) <==> del x[y]

eq(...)

x.__eq__(y) <==> x==y

ge(...)

x.__ge__(y) <==> x>=y

getitem(...)

x.__getitem__(y) <==> x[y]

gt(...)

x.__gt__(y) <==> x>y

iter(...)

x.__iter__() <==> iter(x)

le(...)

x.__le__(y) <==> x<=y

len(...)

x.__len__() <==> len(x)

lt(...)

x.__lt__(y) <==> x

ne(...)

x.__ne__(y) <==> x!=y

setitem(...)

x.__setitem__(i, y) <==> x[i]=y

sizeof(...)

D.__sizeof__() -> size of D in memory, in bytes

clear(...)

D.clear() -> None.  Remove all items from D.

fromkeys(...)

dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.

get(...)

D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.

has_key(...)

D.has_key(k) -> True if D has a key k, else False

items(...)

D.items() -> list of D's (key, value) pairs, as 2-tuples

iteritems(...)

D.iteritems() -> an iterator over the (key, value) items of D

iterkeys(...)

D.iterkeys() -> an iterator over the keys of D

itervalues(...)

D.itervalues() -> an iterator over the values of D

keys(...)

D.keys() -> list of D's keys

pop(...)

D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised

popitem(...)

D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty.

setdefault(...)

D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D

update(...)

D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
In either case, this is followed by: for k in F: D[k] = F[k]

values(...)

D.values() -> list of D's values

viewitems(...)

D.viewitems() -> a set-like object providing a view on D's items

viewkeys(...)

D.viewkeys() -> a set-like object providing a view on D's keys

viewvalues(...)

D.viewvalues() -> an object providing a view on D's values

Attributes from builtin.dict

hash = None
new = <built-in method new of type object>

T.__new__(S, ...) -> a new object with type S, a subtype of T

class pMasters(builtin.object)



Methods

init(self, parent)



repr(self)



groupByWidth(self, double=0.0)



locate(self, master_name, axes_list=None)



locateAxis(self, master_name, axis_tag, width=False)



Descriptors

dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

masters

pFontMetrics

typerig.proxy.objects.font.pFontMetrics = class pFontMetrics(__builtin__.object)

An Abstract Font Metrics getter/setter of a flPackage.

Constructor:
        pFontMetrics() - default represents the current glyph and current font
        pFontMetrics(flPackage)

Methods

__init__(self, font)


asDict(self, layer=None)
# - Export & Import
fromDict(self, metricDict, layer=None)


getAscender(self, layer=None)
# - Getters
getCapsHeight(self, layer=None)


getCaretOffset(self, layer=None)


getDescender(self, layer=None)


getItalicAngle(self, layer=None)


getLineGap(self, layer=None)


getXHeight(self, layer=None)


setAscender(self, value, layer=None)
# - Setters
setCapsHeight(self, value, layer=None)


setCaretOffset(self, value, layer=None)


setDescender(self, value, layer=None)


setItalicAngle(self, value, layer=None)


setLineGap(self, value, layer=None)


setXHeight(self, value, layer=None)


Descriptors

__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

pFont

typerig.proxy.objects.font.pFont = class pFont(__builtin__.object)

A Proxy Font representation of Fonlab fgFont and flPackage.

Constructor:
        pFont(None) : Default represents the current glyph and current font
        pFont(fgFont) : Creates a pFont object from FontGate fgFont object
        pFont(file_path) : Loats a existing font form file_path (str) and creates a pFont object

Methods

__init__(self, font=None)


__repr__(self)


addGlyph(self, glyph)
Adds a Glyph (fgGlyph or flGlyph) to font
addGlyphList(self, glyphList)
Adds a List of Glyphs [fgGlyph or flGlyph] to font
addGuideline(self, flGuide)
Adds a guideline (flGuide) to font guidelines
addOTgroup(self, groupName, glyphList)


addZone(self, position, width, layer=None)
A very dirty way to add a new Zone to Font
add_kerning_group(self, key, glyphNameList, type, layer=None)
Adds a new group to fonts kerning groups.
Args:
        key (string): Group name
        glyphNameList (list(string)): List of glyph names
        type (string): Kern group types: L - Left group (1st), R - Right group (2nd), B - Both (1st and 2nd)
        layer (None, Int, String)

Returns:
        None
alternates(self, namesOnly=False)
Returns all alternate characters (list[fgGlyph])
axes(self)
# - Axes and MM ----------------------------------------------------
clearFeatures(self)


clearGuidelines(self)
Removes all font guidelines
delFeature(self, tag)


delGuideline(self, flGuide)
Removes a guideline (flGuide) from font guidelines
dict_to_kerning_groups(self, groupDict, layer=None)


duplicateGlyph(self, src_name, dst_name, dst_unicode=None, options={'adv': True, 'anc': True, 'flg': True, 'gui': True, 'lnk': True, 'lsb': True, 'out': True, 'ref': True, 'rsb': True, 'tag': True})
Duplicates a glyph and adds it to the font
Args:
        src_name, dst_name (str): Source and destination names
        dst_unicode (int): Unicode int of the new glyph
        references (bool): Keep existing element references (True) or decompose (False)
Returns:
        pGlyph
figures(self, namesOnly=False)
Returns all uppercase characters (list[fgGlyph])
findShape(self, shapeName, master=None)
Search for element (flShape) in font and return it
fl_kerning_groups(self, layer=None)


fl_kerning_groups_to_dict(self, layer=None)


fontMetrics(self)
Returns pFontMetrics Object with getter/setter functionality
fontMetricsInfo(self, layer)
Returns Font(layer) metrics no matter the reference.
Args:
        layer (int or str): Layer index or name. If None returns ActiveLayer
Returns:
        FontMetrics (object)
getFeaPrefix(self)


getFeature(self, tag)


getFeatureTags(self)


getFeatures(self)
# - OpenType and features -------------------------------------
getGlyphNameDict(self)


getGlyphNames(self)
# - Charset -----------------------------------------------
# -- Return Names
getGlyphUnicodeDict(self, encoding='utf-8')


getItalicAngle(self)
# - Font metrics -----------------------------------------------
getOTgroups(self)


getSelectedIndices(self)
# Functions ---------------------------------------------------
# - Font Basics -----------------------------------------------
getZones(self, layer=None, HintingDataType=0)
Returns font alignment (blue) zones (list[flGuideline]). Note: HintingDataType = {'HintingPS': 0, 'HintingTT': 1}
glyph(self, glyph, extend=None)
Return TypeRig proxy glyph object (pGlyph) by index (int) or name (str).
glyphs(self, indexList=[], extend=None)
Return list of FontGate glyph objects (list[fgGlyph]).
guidelines(self, hostInf=False, fontgate=False)
Return font guidelines
Args:
        hostInf (bool): If True Return flHostInfo guidelines host objects
        fontgate (bool): If True return FontGate font guideline objects
Returns
        list[flGuideline] or list[fgGuideline]
hasFeature(self, tag)


hasGlyph(self, glyphName)


hasMaster(self, layerName)


hinting(self)
Returns fonts hinting
instances(self)


kerning(self, layer=None)
Return the fonts kerning object (fgKerning) no matter the reference.
kerning_dump(self, layer=None, mark_groups='@', pairs_only=False)
Dump layer kerning to simple tuples.
Args:
        layer (None, Int, String): Extract kerning data for layer specified;
        mark_groups (String): Mark group kerning with special symbol
        pairs_only (Bool): Export pairs without value

Returns:
        pairs_only is False:    list(tuple(tuple(str(First), str(Second))), Int(Value)))
        pairs_only is True:             list(tuple(str(First), str(Second)))
kerning_groups(self, layer=None)
Return the fonts kerning groups object (fgKerningGroups) no matter the reference.
kerning_groups_to_dict(self, layer=None, byPosition=False, sortUnicode=False)
Return dictionary containing kerning groups 
Args:
        layer (None, Int, String): Extract kerning data for layer specified;
        byPosition (bool): Dictionary by class kerning positions - KernLeft(1st), KernRight(2nd) or KernBothSide(Both);
        sortUnicode (bool): Sort members of kern group according to their Unicode value.

Returns:
        dict
kerning_to_list(self, layer=None)


ligatures(self, namesOnly=False)
Returns all ligature characters (list[fgGlyph])
lowercase(self, namesOnly=False)
Returns all uppercase characters (list[fgGlyph])
masters(self)


newGlyph(self, glyph_name, layers=[], unicode_int=None)
Creates new glyph and adds it to the font
Args:
        glyph_name (str): New glyph name
        layers (list(str) or list(flLayer)): List of layers to be added to the new glyph
        unicode_int (int): Unicode int of the new glyph
Returns:
        pGlyph
newGlyphFromRecipe(self, glyph_name, recipe, layers=[], unicode_int=None, rtl=False)
Generate new glyph (glyph_name) using String Recipe (recipe)
Args:
        glyph_name (str): New glyph name
        recipe (str): Glyph composition recipe using OLD Fontlab syntax (ex. A+acute=Aacute)
        layers (list(str)): List of layer names to be added
        unicode_int (int): Unicode int of the new glyph
        rtl (bool): Right to left
Returns:
        pGlyph
newKernPair(self, glyphLeft, glyphRight, modeLeft, modeRight)


newOTgroup(self, groupName, glyphList)


pGlyphs(self, fgGlyphList=[])
Return list of TypeRig proxy Glyph objects glyph objects (list[pGlyph]).
remove_kerning_group(self, key, layer=None)
Remove a group from fonts kerning groups at given layer.
rename_kerning_group(self, oldkey, newkey, layer=None)
Rename a group in fonts kerning groups at given layer.
reset_kerning_groups(self, layer=None)


selectGlyphs(self, glyphNameList)


selectedGlyphs(self, extend=None)
Return TypeRig proxy glyph object for each selected glyph
selected_pGlyphs(self)
Return TypeRig proxy glyph object for each selected glyph
setFeaPrefix(self, feaString)


setFeature(self, tag, feaString)


setSelectedIndices(self, indList)


setZones(self, fontZones, layer=None)


symbol(self, gID)
Return fgSymbol by glyph index (int)
symbols(self, namesOnly=False)
Returns all uppercase characters (list[fgGlyph])
unselectAll(self)


update(self)


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.
uppercase(self, namesOnly=False)
Returns all uppercase characters (list[fgGlyph])
zonesFromTuples(self, zoneTupleList, layer=None, forceNames=False)


zonesToTuples(self, layer=None, HintingDataType=0)


Descriptors

OTfullName
PSfullName
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
familyName
info
italic_angle
name
path

selected_pGlyphs

typerig.proxy.objects.font.pFont.selected_pGlyphs = selected_pGlyphs(self) unbound typerig.proxy.objects.font.pFont method
Return TypeRig proxy glyph object for each selected glyph

selectedGlyphs

typerig.proxy.objects.font.pFont.selectedGlyphs = selectedGlyphs(self, extend=None) unbound typerig.proxy.objects.font.pFont method
Return TypeRig proxy glyph object for each selected glyph

glyph

typerig.proxy.objects.font.pFont.glyph = glyph(self, glyph, extend=None) unbound typerig.proxy.objects.font.pFont method
Return TypeRig proxy glyph object (pGlyph) by index (int) or name (str).

symbol

typerig.proxy.objects.font.pFont.symbol = symbol(self, gID) unbound typerig.proxy.objects.font.pFont method
Return fgSymbol by glyph index (int)

glyphs

typerig.proxy.objects.font.pFont.glyphs = glyphs(self, indexList=[], extend=None) unbound typerig.proxy.objects.font.pFont method
Return list of FontGate glyph objects (list[fgGlyph]).

pGlyphs

typerig.proxy.objects.font.pFont.pGlyphs = pGlyphs(self, fgGlyphList=[]) unbound typerig.proxy.objects.font.pFont method
Return list of TypeRig proxy Glyph objects glyph objects (list[pGlyph]).

findShape

typerig.proxy.objects.font.pFont.findShape = findShape(self, shapeName, master=None) unbound typerig.proxy.objects.font.pFont method
Search for element (flShape) in font and return it

fontMetricsInfo

typerig.proxy.objects.font.pFont.fontMetricsInfo = fontMetricsInfo(self, layer) unbound typerig.proxy.objects.font.pFont 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)

fontMetrics

typerig.proxy.objects.font.pFont.fontMetrics = fontMetrics(self) unbound typerig.proxy.objects.font.pFont method
Returns pFontMetrics Object with getter/setter functionality

updateObject

typerig.proxy.objects.font.pFont.updateObject = updateObject(self, flObject, undoMessage='TypeRig', verbose=True) unbound typerig.proxy.objects.font.pFont 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.

guidelines

typerig.proxy.objects.font.pFont.guidelines = guidelines(self, hostInf=False, fontgate=False) unbound typerig.proxy.objects.font.pFont method
Return font guidelines
Args:
        hostInf (bool): If True Return flHostInfo guidelines host objects
        fontgate (bool): If True return FontGate font guideline objects
Returns
        list[flGuideline] or list[fgGuideline]

addGuideline

typerig.proxy.objects.font.pFont.addGuideline = addGuideline(self, flGuide) unbound typerig.proxy.objects.font.pFont method
Adds a guideline (flGuide) to font guidelines

delGuideline

typerig.proxy.objects.font.pFont.delGuideline = delGuideline(self, flGuide) unbound typerig.proxy.objects.font.pFont method
Removes a guideline (flGuide) from font guidelines

clearGuidelines

typerig.proxy.objects.font.pFont.clearGuidelines = clearGuidelines(self) unbound typerig.proxy.objects.font.pFont method
Removes all font guidelines

getZones

typerig.proxy.objects.font.pFont.getZones = getZones(self, layer=None, HintingDataType=0) unbound typerig.proxy.objects.font.pFont method
Returns font alignment (blue) zones (list[flGuideline]). Note: HintingDataType = {'HintingPS': 0, 'HintingTT': 1}

addZone

typerig.proxy.objects.font.pFont.addZone = addZone(self, position, width, layer=None) unbound typerig.proxy.objects.font.pFont method
A very dirty way to add a new Zone to Font

hinting

typerig.proxy.objects.font.pFont.hinting = hinting(self) unbound typerig.proxy.objects.font.pFont method
Returns fonts hinting

uppercase

typerig.proxy.objects.font.pFont.uppercase = uppercase(self, namesOnly=False) unbound typerig.proxy.objects.font.pFont method
Returns all uppercase characters (list[fgGlyph])

lowercase

typerig.proxy.objects.font.pFont.lowercase = lowercase(self, namesOnly=False) unbound typerig.proxy.objects.font.pFont method
Returns all uppercase characters (list[fgGlyph])

figures

typerig.proxy.objects.font.pFont.figures = figures(self, namesOnly=False) unbound typerig.proxy.objects.font.pFont method
Returns all uppercase characters (list[fgGlyph])

symbols

typerig.proxy.objects.font.pFont.symbols = symbols(self, namesOnly=False) unbound typerig.proxy.objects.font.pFont method
Returns all uppercase characters (list[fgGlyph])

ligatures

typerig.proxy.objects.font.pFont.ligatures = ligatures(self, namesOnly=False) unbound typerig.proxy.objects.font.pFont method
Returns all ligature characters (list[fgGlyph])

alternates

typerig.proxy.objects.font.pFont.alternates = alternates(self, namesOnly=False) unbound typerig.proxy.objects.font.pFont method
Returns all alternate characters (list[fgGlyph])

addGlyph

typerig.proxy.objects.font.pFont.addGlyph = addGlyph(self, glyph) unbound typerig.proxy.objects.font.pFont method
Adds a Glyph (fgGlyph or flGlyph) to font

addGlyphList

typerig.proxy.objects.font.pFont.addGlyphList = addGlyphList(self, glyphList) unbound typerig.proxy.objects.font.pFont method
Adds a List of Glyphs [fgGlyph or flGlyph] to font

newGlyph

typerig.proxy.objects.font.pFont.newGlyph = newGlyph(self, glyph_name, layers=[], unicode_int=None) unbound typerig.proxy.objects.font.pFont method
Creates new glyph and adds it to the font
Args:
        glyph_name (str): New glyph name
        layers (list(str) or list(flLayer)): List of layers to be added to the new glyph
        unicode_int (int): Unicode int of the new glyph
Returns:
        pGlyph

newGlyphFromRecipe

typerig.proxy.objects.font.pFont.newGlyphFromRecipe = newGlyphFromRecipe(self, glyph_name, recipe, layers=[], unicode_int=None, rtl=False) unbound typerig.proxy.objects.font.pFont method
Generate new glyph (glyph_name) using String Recipe (recipe)
Args:
        glyph_name (str): New glyph name
        recipe (str): Glyph composition recipe using OLD Fontlab syntax (ex. A+acute=Aacute)
        layers (list(str)): List of layer names to be added
        unicode_int (int): Unicode int of the new glyph
        rtl (bool): Right to left
Returns:
        pGlyph

duplicateGlyph

typerig.proxy.objects.font.pFont.duplicateGlyph = duplicateGlyph(self, src_name, dst_name, dst_unicode=None, options={'adv': True, 'anc': True, 'flg': True, 'gui': True, 'lnk': True, 'lsb': True, 'out': True, 'ref': True, 'rsb': True, 'tag': True}) unbound typerig.proxy.objects.font.pFont method
Duplicates a glyph and adds it to the font
Args:
        src_name, dst_name (str): Source and destination names
        dst_unicode (int): Unicode int of the new glyph
        references (bool): Keep existing element references (True) or decompose (False)
Returns:
        pGlyph

kerning

typerig.proxy.objects.font.pFont.kerning = kerning(self, layer=None) unbound typerig.proxy.objects.font.pFont method
Return the fonts kerning object (fgKerning) no matter the reference.

kerning_dump

typerig.proxy.objects.font.pFont.kerning_dump = kerning_dump(self, layer=None, mark_groups='@', pairs_only=False) unbound typerig.proxy.objects.font.pFont method
Dump layer kerning to simple tuples.
Args:
        layer (None, Int, String): Extract kerning data for layer specified;
        mark_groups (String): Mark group kerning with special symbol
        pairs_only (Bool): Export pairs without value

Returns:
        pairs_only is False:    list(tuple(tuple(str(First), str(Second))), Int(Value)))
        pairs_only is True:             list(tuple(str(First), str(Second)))

kerning_groups

typerig.proxy.objects.font.pFont.kerning_groups = kerning_groups(self, layer=None) unbound typerig.proxy.objects.font.pFont method
Return the fonts kerning groups object (fgKerningGroups) no matter the reference.

kerning_groups_to_dict

typerig.proxy.objects.font.pFont.kerning_groups_to_dict = kerning_groups_to_dict(self, layer=None, byPosition=False, sortUnicode=False) unbound typerig.proxy.objects.font.pFont method
Return dictionary containing kerning groups 
Args:
        layer (None, Int, String): Extract kerning data for layer specified;
        byPosition (bool): Dictionary by class kerning positions - KernLeft(1st), KernRight(2nd) or KernBothSide(Both);
        sortUnicode (bool): Sort members of kern group according to their Unicode value.

Returns:
        dict

add_kerning_group

typerig.proxy.objects.font.pFont.add_kerning_group = add_kerning_group(self, key, glyphNameList, type, layer=None) unbound typerig.proxy.objects.font.pFont method
Adds a new group to fonts kerning groups.
Args:
        key (string): Group name
        glyphNameList (list(string)): List of glyph names
        type (string): Kern group types: L - Left group (1st), R - Right group (2nd), B - Both (1st and 2nd)
        layer (None, Int, String)

Returns:
        None

remove_kerning_group

typerig.proxy.objects.font.pFont.remove_kerning_group = remove_kerning_group(self, key, layer=None) unbound typerig.proxy.objects.font.pFont method
Remove a group from fonts kerning groups at given layer.

rename_kerning_group

typerig.proxy.objects.font.pFont.rename_kerning_group = rename_kerning_group(self, oldkey, newkey, layer=None) unbound typerig.proxy.objects.font.pFont method
Rename a group in fonts kerning groups at given layer.

eFont

typerig.proxy.objects.font.eFont = class eFont(pFont)

Proxy Font extension, packing some useful tools.

Constructor:
        eFont() - default represents the current glyph and current font
        eFont(fgFont)
Method resolution order:
eFont
pFont
__builtin__.object

Methods

copyZones(self, font)


Methods from pFont

__init__(self, font=None)


__repr__(self)


addGlyph(self, glyph)
Adds a Glyph (fgGlyph or flGlyph) to font
addGlyphList(self, glyphList)
Adds a List of Glyphs [fgGlyph or flGlyph] to font
addGuideline(self, flGuide)
Adds a guideline (flGuide) to font guidelines
addOTgroup(self, groupName, glyphList)


addZone(self, position, width, layer=None)
A very dirty way to add a new Zone to Font
add_kerning_group(self, key, glyphNameList, type, layer=None)
Adds a new group to fonts kerning groups.
Args:
        key (string): Group name
        glyphNameList (list(string)): List of glyph names
        type (string): Kern group types: L - Left group (1st), R - Right group (2nd), B - Both (1st and 2nd)
        layer (None, Int, String)

Returns:
        None
alternates(self, namesOnly=False)
Returns all alternate characters (list[fgGlyph])
axes(self)
# - Axes and MM ----------------------------------------------------
clearFeatures(self)


clearGuidelines(self)
Removes all font guidelines
delFeature(self, tag)


delGuideline(self, flGuide)
Removes a guideline (flGuide) from font guidelines
dict_to_kerning_groups(self, groupDict, layer=None)


duplicateGlyph(self, src_name, dst_name, dst_unicode=None, options={'adv': True, 'anc': True, 'flg': True, 'gui': True, 'lnk': True, 'lsb': True, 'out': True, 'ref': True, 'rsb': True, 'tag': True})
Duplicates a glyph and adds it to the font
Args:
        src_name, dst_name (str): Source and destination names
        dst_unicode (int): Unicode int of the new glyph
        references (bool): Keep existing element references (True) or decompose (False)
Returns:
        pGlyph
figures(self, namesOnly=False)
Returns all uppercase characters (list[fgGlyph])
findShape(self, shapeName, master=None)
Search for element (flShape) in font and return it
fl_kerning_groups(self, layer=None)


fl_kerning_groups_to_dict(self, layer=None)


fontMetrics(self)
Returns pFontMetrics Object with getter/setter functionality
fontMetricsInfo(self, layer)
Returns Font(layer) metrics no matter the reference.
Args:
        layer (int or str): Layer index or name. If None returns ActiveLayer
Returns:
        FontMetrics (object)
getFeaPrefix(self)


getFeature(self, tag)


getFeatureTags(self)


getFeatures(self)
# - OpenType and features -------------------------------------
getGlyphNameDict(self)


getGlyphNames(self)
# - Charset -----------------------------------------------
# -- Return Names
getGlyphUnicodeDict(self, encoding='utf-8')


getItalicAngle(self)
# - Font metrics -----------------------------------------------
getOTgroups(self)


getSelectedIndices(self)
# Functions ---------------------------------------------------
# - Font Basics -----------------------------------------------
getZones(self, layer=None, HintingDataType=0)
Returns font alignment (blue) zones (list[flGuideline]). Note: HintingDataType = {'HintingPS': 0, 'HintingTT': 1}
glyph(self, glyph, extend=None)
Return TypeRig proxy glyph object (pGlyph) by index (int) or name (str).
glyphs(self, indexList=[], extend=None)
Return list of FontGate glyph objects (list[fgGlyph]).
guidelines(self, hostInf=False, fontgate=False)
Return font guidelines
Args:
        hostInf (bool): If True Return flHostInfo guidelines host objects
        fontgate (bool): If True return FontGate font guideline objects
Returns
        list[flGuideline] or list[fgGuideline]
hasFeature(self, tag)


hasGlyph(self, glyphName)


hasMaster(self, layerName)


hinting(self)
Returns fonts hinting
instances(self)


kerning(self, layer=None)
Return the fonts kerning object (fgKerning) no matter the reference.
kerning_dump(self, layer=None, mark_groups='@', pairs_only=False)
Dump layer kerning to simple tuples.
Args:
        layer (None, Int, String): Extract kerning data for layer specified;
        mark_groups (String): Mark group kerning with special symbol
        pairs_only (Bool): Export pairs without value

Returns:
        pairs_only is False:    list(tuple(tuple(str(First), str(Second))), Int(Value)))
        pairs_only is True:             list(tuple(str(First), str(Second)))
kerning_groups(self, layer=None)
Return the fonts kerning groups object (fgKerningGroups) no matter the reference.
kerning_groups_to_dict(self, layer=None, byPosition=False, sortUnicode=False)
Return dictionary containing kerning groups 
Args:
        layer (None, Int, String): Extract kerning data for layer specified;
        byPosition (bool): Dictionary by class kerning positions - KernLeft(1st), KernRight(2nd) or KernBothSide(Both);
        sortUnicode (bool): Sort members of kern group according to their Unicode value.

Returns:
        dict
kerning_to_list(self, layer=None)


ligatures(self, namesOnly=False)
Returns all ligature characters (list[fgGlyph])
lowercase(self, namesOnly=False)
Returns all uppercase characters (list[fgGlyph])
masters(self)


newGlyph(self, glyph_name, layers=[], unicode_int=None)
Creates new glyph and adds it to the font
Args:
        glyph_name (str): New glyph name
        layers (list(str) or list(flLayer)): List of layers to be added to the new glyph
        unicode_int (int): Unicode int of the new glyph
Returns:
        pGlyph
newGlyphFromRecipe(self, glyph_name, recipe, layers=[], unicode_int=None, rtl=False)
Generate new glyph (glyph_name) using String Recipe (recipe)
Args:
        glyph_name (str): New glyph name
        recipe (str): Glyph composition recipe using OLD Fontlab syntax (ex. A+acute=Aacute)
        layers (list(str)): List of layer names to be added
        unicode_int (int): Unicode int of the new glyph
        rtl (bool): Right to left
Returns:
        pGlyph
newKernPair(self, glyphLeft, glyphRight, modeLeft, modeRight)


newOTgroup(self, groupName, glyphList)


pGlyphs(self, fgGlyphList=[])
Return list of TypeRig proxy Glyph objects glyph objects (list[pGlyph]).
remove_kerning_group(self, key, layer=None)
Remove a group from fonts kerning groups at given layer.
rename_kerning_group(self, oldkey, newkey, layer=None)
Rename a group in fonts kerning groups at given layer.
reset_kerning_groups(self, layer=None)


selectGlyphs(self, glyphNameList)


selectedGlyphs(self, extend=None)
Return TypeRig proxy glyph object for each selected glyph
selected_pGlyphs(self)
Return TypeRig proxy glyph object for each selected glyph
setFeaPrefix(self, feaString)


setFeature(self, tag, feaString)


setSelectedIndices(self, indList)


setZones(self, fontZones, layer=None)


symbol(self, gID)
Return fgSymbol by glyph index (int)
symbols(self, namesOnly=False)
Returns all uppercase characters (list[fgGlyph])
unselectAll(self)


update(self)


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.
uppercase(self, namesOnly=False)
Returns all uppercase characters (list[fgGlyph])
zonesFromTuples(self, zoneTupleList, layer=None, forceNames=False)


zonesToTuples(self, layer=None, HintingDataType=0)


Descriptors from pFont

OTfullName
PSfullName
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
familyName
info
italic_angle
name
path

jFont

typerig.proxy.objects.font.jFont = class jFont(__builtin__.object)

Proxy VFJ Font (Fontlab JSON Font format)

Constructor:
        jFont(): Construct an empty jFont
        jFont(vfj_file_path): Load VFJ form vfj_file_path (STR)
        jFont(pFont): Load VFJ from pFont.path. VFJ Font has to be in the same path as the VFC

Methods:
        .data(): Access to VFJ font
        .load(file_path): Load VFJ font from path
        .save_as(file_path): Save VFJ font to path
        .save(): Save VFJ (overwrite)

Methods

__init__(self, source=None)


load(self, file_path)


save(self)


save_as(self, file_path)


Descriptors

__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)