markFeature

A very simple mark feature builder for accented glyphs.

class markToBaseFeaBuilder(font, markToBaseDict)

An object to create mark feature code from a list of base glyphs and mark glyphs with named anchors.

from hTools3.modules.markFeature import markToBaseFeaBuilder

f = CurrentFont()

markToBaseDict = {
    'x'     : [('tildecmb', 'top'), ('gravecmb', 'top'), ('cedillacmb', 'bottom')],
    'X'     : [('tildecmb', 'top')],
    'one'   : [('tildecmb', 'top'), ('cedillacmb', 'bottom')],
    'two'   : [('gravecmb', 'top')],
    'three' : [('tildecmb', 'top')],
}

M = markToBaseFeaBuilder(f, markToBaseDict)
M.verbose = True
M.buildDicts()
M.write()

print(f.features.text)
verbose = True
__init__(font, markToBaseDict)
property allBases

Returns a list of all base glyph names.

property allMarks

Returns a list of all mark glyph names.

property allMarkClasses

Returns a list of all mark class names.

property fontName

Returns the name of the font.

makeMarkClassName(markName)

Creates a mark class name for the given mark name.

writeMarkClasses()

Create markClass statements.

writeMarkFeature()

Create mark feature code.

writeTableGDEF()

Create code for GDEF table.

buildDicts()

Transform raw input data into internal data structures.

compile()

Compile the available data into mark feature code.

write(langsystem=True)

Write the mark feature code into the font.

Adds boilerplate languagesystem statements at the top.