Merge pull request #2027 from simoncozens/mtilib-docs
Document mtiLib library
This commit is contained in:
commit
68cbcd10cd
@ -1,8 +1,14 @@
|
|||||||
######
|
###########################################
|
||||||
mtiLib
|
mtiLib: Read Monotype FontDame source files
|
||||||
######
|
###########################################
|
||||||
|
|
||||||
|
FontTools provides support for reading the OpenType layout tables produced by
|
||||||
|
Monotype's FontDame and Font Chef font editors. These tables are written in a
|
||||||
|
simple textual format. The ``mtiLib`` library parses these text files and creates
|
||||||
|
table objects representing their contents.
|
||||||
|
|
||||||
|
Additionally, ``fonttools mtiLib`` will convert a text file to TTX XML.
|
||||||
|
|
||||||
|
|
||||||
.. automodule:: fontTools.mtiLib
|
.. automodule:: fontTools.mtiLib
|
||||||
:inherited-members:
|
:members: build, main
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
|
@ -1146,12 +1146,33 @@ class Tokenizer(object):
|
|||||||
return line
|
return line
|
||||||
|
|
||||||
def build(f, font, tableTag=None):
|
def build(f, font, tableTag=None):
|
||||||
|
"""Convert a Monotype font layout file to an OpenType layout object
|
||||||
|
|
||||||
|
A font object must be passed, but this may be a "dummy" font; it is only
|
||||||
|
used for sorting glyph sets when making coverage tables and to hold the
|
||||||
|
OpenType layout table while it is being built.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
f: A file object.
|
||||||
|
font (TTFont): A font object.
|
||||||
|
tableTag (string): If provided, asserts that the file contains data for the
|
||||||
|
given OpenType table.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An object representing the table. (e.g. ``table_G_S_U_B_``)
|
||||||
|
"""
|
||||||
lines = Tokenizer(f)
|
lines = Tokenizer(f)
|
||||||
return parseTable(lines, font, tableTag=tableTag)
|
return parseTable(lines, font, tableTag=tableTag)
|
||||||
|
|
||||||
|
|
||||||
def main(args=None, font=None):
|
def main(args=None, font=None):
|
||||||
"""Convert a FontDame OTL file to TTX XML"""
|
"""Convert a FontDame OTL file to TTX XML.
|
||||||
|
|
||||||
|
Writes XML output to stdout.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
args: Command line arguments (``--font``, ``--table``, input files).
|
||||||
|
"""
|
||||||
import sys
|
import sys
|
||||||
from fontTools import configLogger
|
from fontTools import configLogger
|
||||||
from fontTools.misc.testTools import MockFont
|
from fontTools.misc.testTools import MockFont
|
||||||
|
Loading…
x
Reference in New Issue
Block a user