cffLib¶
cffLib.py – read/write tools for Adobe CFF fonts.
-
class
fontTools.cffLib.
CharStrings
(file, charset, globalSubrs, private, fdSelect, fdArray, isCFF2=None)[source]¶
-
class
fontTools.cffLib.
DictCompiler
(dictObj, strings, parent, isCFF2=None)[source]¶ -
-
arg_delta_blend
(value)[source]¶ A delta list with blend lists has to be all blend lists. The value is a list is arranged as follows. [
[V0, d0..dn] [V1, d0..dn] … [Vm, d0..dn]] V is the absolute coordinate value from the default font, and d0-dn are the delta values from the n regions. Each V is an absolute coordinate from the default font. We want to return a list: [
[v0, v1..vm] [d0..dn] … [d0..dn] numBlends blendOp] where each v is relative to the previous default font value.
-
maxBlendStack
= 0¶
-
-
class
fontTools.cffLib.
FDArrayIndex
(file=None, isCFF2=None)[source]¶ -
compilerClass
¶ alias of
FDArrayIndexCompiler
-
-
class
fontTools.cffLib.
FontDict
(strings=None, file=None, offset=None, GlobalSubrs=None, isCFF2=None, vstore=None)[source]¶ -
compilerClass
¶ alias of
FontDictCompiler
-
converters
= {'BaseFontBlend': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbc95c0>, 'BaseFontName': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc9588>, 'CIDCount': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc96a0>, 'CIDFontRevision': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9630>, 'CIDFontType': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9668>, 'CIDFontVersion': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc95f8>, 'CharStrings': <fontTools.cffLib.CharStringsConverter object at 0x7f1eccbaeac8>, 'CharstringType': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9400>, 'Copyright': <fontTools.cffLib.Latin1Converter object at 0x7f1eccbae978>, 'Encoding': <fontTools.cffLib.EncodingConverter object at 0x7f1eccbae9e8>, 'FDArray': <fontTools.cffLib.FDArrayConverter object at 0x7f1eccbaea90>, 'FDSelect': <fontTools.cffLib.FDSelectConverter object at 0x7f1eccbaea58>, 'FamilyName': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc9278>, 'FontBBox': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbc94a8>, 'FontMatrix': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbc9438>, 'FontName': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc9240>, 'FullName': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc9208>, 'ItalicAngle': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9320>, 'Notice': <fontTools.cffLib.Latin1Converter object at 0x7f1eccbae940>, 'PaintType': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc93c8>, 'PostScript': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc9550>, 'Private': <fontTools.cffLib.PrivateDictConverter object at 0x7f1eccbaea20>, 'ROS': <fontTools.cffLib.ROSConverter object at 0x7f1eccbae908>, 'StrokeWidth': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc94e0>, 'SyntheticBase': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9198>, 'UIDBase': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc96d8>, 'UnderlinePosition': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9358>, 'UnderlineThickness': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9390>, 'UniqueID': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9470>, 'VarStore': <fontTools.cffLib.VarStoreConverter object at 0x7f1eccbaeb00>, 'Weight': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc92b0>, 'XUID': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbc9518>, 'charset': <fontTools.cffLib.CharsetConverter object at 0x7f1eccbae9b0>, 'isFixedPitch': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc92e8>, 'maxstack': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9160>, 'version': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc91d0>}¶
-
decompilerClass
¶ alias of
TopDictDecompiler
-
defaults
= {}¶
-
order
= ['FontName', 'FontMatrix', 'Weight', 'Private']¶
-
-
class
fontTools.cffLib.
FontDictCompiler
(dictObj, strings, parent, isCFF2=None)[source]¶ -
-
opcodes
= {'BaseFontBlend': (b'\x0c\x17', 'delta'), 'BaseFontName': (b'\x0c\x16', 'SID'), 'CIDCount': (b'\x0c"', 'number'), 'CIDFontRevision': (b'\x0c ', 'number'), 'CIDFontType': (b'\x0c!', 'number'), 'CIDFontVersion': (b'\x0c\x1f', 'number'), 'CharStrings': (b'\x11', 'number'), 'CharstringType': (b'\x0c\x06', 'number'), 'Copyright': (b'\x0c\x00', 'SID'), 'Encoding': (b'\x10', 'number'), 'FDArray': (b'\x0c$', 'number'), 'FDSelect': (b'\x0c%', 'number'), 'FamilyName': (b'\x03', 'SID'), 'FontBBox': (b'\x05', 'array'), 'FontMatrix': (b'\x0c\x07', 'array'), 'FontName': (b'\x0c&', 'SID'), 'FullName': (b'\x02', 'SID'), 'ItalicAngle': (b'\x0c\x02', 'number'), 'Notice': (b'\x01', 'SID'), 'PaintType': (b'\x0c\x05', 'number'), 'PostScript': (b'\x0c\x15', 'SID'), 'Private': (b'\x12', ('number', 'number')), 'ROS': (b'\x0c\x1e', ('SID', 'SID', 'number')), 'StrokeWidth': (b'\x0c\x08', 'number'), 'SyntheticBase': (b'\x0c\x14', 'number'), 'UIDBase': (b'\x0c#', 'number'), 'UnderlinePosition': (b'\x0c\x03', 'number'), 'UnderlineThickness': (b'\x0c\x04', 'number'), 'UniqueID': (b'\r', 'number'), 'VarStore': (b'\x18', 'number'), 'Weight': (b'\x04', 'SID'), 'XUID': (b'\x0e', 'array'), 'charset': (b'\x0f', 'number'), 'isFixedPitch': (b'\x0c\x01', 'number'), 'maxstack': (b'\x19', 'number'), 'version': (b'\x00', 'SID')}¶
-
-
class
fontTools.cffLib.
GlobalSubrsIndex
(file=None, globalSubrs=None, private=None, fdSelect=None, fdArray=None, isCFF2=None)[source]¶ -
charStringClass
¶ alias of
T2CharString
-
compilerClass
¶ alias of
GlobalSubrsCompiler
-
subrClass
¶ alias of
T2CharString
-
-
class
fontTools.cffLib.
Index
(file=None, isCFF2=None)[source]¶ This class represents what the CFF spec calls an INDEX.
-
compilerClass
¶ alias of
IndexCompiler
-
-
class
fontTools.cffLib.
PrivateDict
(strings=None, file=None, offset=None, isCFF2=None, vstore=None)[source]¶ -
compilerClass
¶ alias of
PrivateDictCompiler
-
converters
= {'BlueFuzz': <fontTools.cffLib.NumberConverter object at 0x7f1eccbaee48>, 'BlueScale': <fontTools.cffLib.NumberConverter object at 0x7f1eccbaedd8>, 'BlueShift': <fontTools.cffLib.NumberConverter object at 0x7f1eccbaee10>, 'BlueValues': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbaecf8>, 'ExpansionFactor': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9080>, 'FamilyBlues': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbaed68>, 'FamilyOtherBlues': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbaeda0>, 'ForceBold': <fontTools.cffLib.NumberConverter object at 0x7f1eccbaef60>, 'ForceBoldThreshold': <fontTools.cffLib.NumberConverter object at 0x7f1eccbaef98>, 'LanguageGroup': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9048>, 'OtherBlues': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbaed30>, 'StdHW': <fontTools.cffLib.NumberConverter object at 0x7f1eccbaee80>, 'StdVW': <fontTools.cffLib.NumberConverter object at 0x7f1eccbaeeb8>, 'StemSnapH': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbaeef0>, 'StemSnapV': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbaef28>, 'Subrs': <fontTools.cffLib.SubrsConverter object at 0x7f1eccbaec18>, 'blend': None, 'defaultWidthX': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc90f0>, 'initialRandomSeed': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc90b8>, 'lenIV': <fontTools.cffLib.NumberConverter object at 0x7f1eccbaefd0>, 'nominalWidthX': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9128>, 'vsindex': <fontTools.cffLib.NumberConverter object at 0x7f1eccbaecc0>}¶
-
decompilerClass
¶ alias of
PrivateDictDecompiler
-
defaults
= {'BlueFuzz': 1, 'BlueScale': 0.039625, 'BlueShift': 7, 'ExpansionFactor': 0.06, 'ForceBold': 0, 'LanguageGroup': 0, 'defaultWidthX': 0, 'initialRandomSeed': 0, 'nominalWidthX': 0}¶
-
order
= ['vsindex', 'blend', 'BlueValues', 'OtherBlues', 'FamilyBlues', 'FamilyOtherBlues', 'BlueScale', 'BlueShift', 'BlueFuzz', 'StdHW', 'StdVW', 'StemSnapH', 'StemSnapV', 'ForceBold', 'ForceBoldThreshold', 'lenIV', 'LanguageGroup', 'ExpansionFactor', 'initialRandomSeed', 'defaultWidthX', 'nominalWidthX', 'Subrs']¶
-
-
class
fontTools.cffLib.
PrivateDictCompiler
(dictObj, strings, parent, isCFF2=None)[source]¶ -
-
maxBlendStack
= 513¶
-
opcodes
= {'BlueFuzz': (b'\x0c\x0b', 'number'), 'BlueScale': (b'\x0c\t', 'number'), 'BlueShift': (b'\x0c\n', 'number'), 'BlueValues': (b'\x06', 'delta'), 'ExpansionFactor': (b'\x0c\x12', 'number'), 'FamilyBlues': (b'\x08', 'delta'), 'FamilyOtherBlues': (b'\t', 'delta'), 'ForceBold': (b'\x0c\x0e', 'number'), 'ForceBoldThreshold': (b'\x0c\x0f', 'number'), 'LanguageGroup': (b'\x0c\x11', 'number'), 'OtherBlues': (b'\x07', 'delta'), 'StdHW': (b'\n', 'number'), 'StdVW': (b'\x0b', 'number'), 'StemSnapH': (b'\x0c\x0c', 'delta'), 'StemSnapV': (b'\x0c\r', 'delta'), 'Subrs': (b'\x13', 'number'), 'blend': (b'\x17', 'blendList'), 'defaultWidthX': (b'\x14', 'number'), 'initialRandomSeed': (b'\x0c\x13', 'number'), 'lenIV': (b'\x0c\x10', 'number'), 'nominalWidthX': (b'\x15', 'number'), 'vsindex': (b'\x16', 'number')}¶
-
-
class
fontTools.cffLib.
PrivateDictDecompiler
(strings, parent=None)[source]¶ -
operators
= {22: ('vsindex', 'number'), 23: ('blend', 'blendList'), 6: ('BlueValues', 'delta'), 7: ('OtherBlues', 'delta'), 8: ('FamilyBlues', 'delta'), 9: ('FamilyOtherBlues', 'delta'), (12, 9): ('BlueScale', 'number'), (12, 10): ('BlueShift', 'number'), (12, 11): ('BlueFuzz', 'number'), 10: ('StdHW', 'number'), 11: ('StdVW', 'number'), (12, 12): ('StemSnapH', 'delta'), (12, 13): ('StemSnapV', 'delta'), (12, 14): ('ForceBold', 'number'), (12, 15): ('ForceBoldThreshold', 'number'), (12, 16): ('lenIV', 'number'), (12, 17): ('LanguageGroup', 'number'), (12, 18): ('ExpansionFactor', 'number'), (12, 19): ('initialRandomSeed', 'number'), 20: ('defaultWidthX', 'number'), 21: ('nominalWidthX', 'number'), 19: ('Subrs', 'number')}¶
-
-
class
fontTools.cffLib.
SubrsIndex
(file=None, globalSubrs=None, private=None, fdSelect=None, fdArray=None, isCFF2=None)[source]¶ -
compilerClass
¶ alias of
SubrsCompiler
-
-
class
fontTools.cffLib.
TopDict
(strings=None, file=None, offset=None, GlobalSubrs=None, cff2GetGlyphOrder=None, isCFF2=None)[source]¶ -
compilerClass
¶ alias of
TopDictCompiler
-
converters
= {'BaseFontBlend': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbc95c0>, 'BaseFontName': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc9588>, 'CIDCount': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc96a0>, 'CIDFontRevision': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9630>, 'CIDFontType': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9668>, 'CIDFontVersion': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc95f8>, 'CharStrings': <fontTools.cffLib.CharStringsConverter object at 0x7f1eccbaeac8>, 'CharstringType': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9400>, 'Copyright': <fontTools.cffLib.Latin1Converter object at 0x7f1eccbae978>, 'Encoding': <fontTools.cffLib.EncodingConverter object at 0x7f1eccbae9e8>, 'FDArray': <fontTools.cffLib.FDArrayConverter object at 0x7f1eccbaea90>, 'FDSelect': <fontTools.cffLib.FDSelectConverter object at 0x7f1eccbaea58>, 'FamilyName': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc9278>, 'FontBBox': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbc94a8>, 'FontMatrix': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbc9438>, 'FontName': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc9240>, 'FullName': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc9208>, 'ItalicAngle': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9320>, 'Notice': <fontTools.cffLib.Latin1Converter object at 0x7f1eccbae940>, 'PaintType': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc93c8>, 'PostScript': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc9550>, 'Private': <fontTools.cffLib.PrivateDictConverter object at 0x7f1eccbaea20>, 'ROS': <fontTools.cffLib.ROSConverter object at 0x7f1eccbae908>, 'StrokeWidth': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc94e0>, 'SyntheticBase': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9198>, 'UIDBase': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc96d8>, 'UnderlinePosition': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9358>, 'UnderlineThickness': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9390>, 'UniqueID': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9470>, 'VarStore': <fontTools.cffLib.VarStoreConverter object at 0x7f1eccbaeb00>, 'Weight': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc92b0>, 'XUID': <fontTools.cffLib.ArrayConverter object at 0x7f1eccbc9518>, 'charset': <fontTools.cffLib.CharsetConverter object at 0x7f1eccbae9b0>, 'isFixedPitch': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc92e8>, 'maxstack': <fontTools.cffLib.NumberConverter object at 0x7f1eccbc9160>, 'version': <fontTools.cffLib.ASCIIConverter object at 0x7f1eccbc91d0>}¶
-
decompilerClass
¶ alias of
TopDictDecompiler
-
defaults
= {'CIDCount': 8720, 'CIDFontRevision': 0, 'CIDFontType': 0, 'CIDFontVersion': 0, 'CharstringType': 2, 'Encoding': 0, 'FontBBox': [0, 0, 0, 0], 'FontMatrix': [0.001, 0, 0, 0.001, 0, 0], 'ItalicAngle': 0, 'PaintType': 0, 'StrokeWidth': 0, 'UnderlinePosition': -100, 'UnderlineThickness': 50, 'isFixedPitch': 0}¶
-
order
= ['maxstack', 'ROS', 'SyntheticBase', 'version', 'Notice', 'Copyright', 'FullName', 'FontName', 'FamilyName', 'Weight', 'isFixedPitch', 'ItalicAngle', 'UnderlinePosition', 'UnderlineThickness', 'PaintType', 'CharstringType', 'FontMatrix', 'UniqueID', 'FontBBox', 'StrokeWidth', 'XUID', 'PostScript', 'BaseFontName', 'BaseFontBlend', 'CIDFontVersion', 'CIDFontRevision', 'CIDFontType', 'CIDCount', 'charset', 'UIDBase', 'Encoding', 'Private', 'FDSelect', 'FDArray', 'CharStrings', 'VarStore']¶
-
-
class
fontTools.cffLib.
TopDictCompiler
(dictObj, strings, parent, isCFF2=None)[source]¶ -
-
opcodes
= {'BaseFontBlend': (b'\x0c\x17', 'delta'), 'BaseFontName': (b'\x0c\x16', 'SID'), 'CIDCount': (b'\x0c"', 'number'), 'CIDFontRevision': (b'\x0c ', 'number'), 'CIDFontType': (b'\x0c!', 'number'), 'CIDFontVersion': (b'\x0c\x1f', 'number'), 'CharStrings': (b'\x11', 'number'), 'CharstringType': (b'\x0c\x06', 'number'), 'Copyright': (b'\x0c\x00', 'SID'), 'Encoding': (b'\x10', 'number'), 'FDArray': (b'\x0c$', 'number'), 'FDSelect': (b'\x0c%', 'number'), 'FamilyName': (b'\x03', 'SID'), 'FontBBox': (b'\x05', 'array'), 'FontMatrix': (b'\x0c\x07', 'array'), 'FontName': (b'\x0c&', 'SID'), 'FullName': (b'\x02', 'SID'), 'ItalicAngle': (b'\x0c\x02', 'number'), 'Notice': (b'\x01', 'SID'), 'PaintType': (b'\x0c\x05', 'number'), 'PostScript': (b'\x0c\x15', 'SID'), 'Private': (b'\x12', ('number', 'number')), 'ROS': (b'\x0c\x1e', ('SID', 'SID', 'number')), 'StrokeWidth': (b'\x0c\x08', 'number'), 'SyntheticBase': (b'\x0c\x14', 'number'), 'UIDBase': (b'\x0c#', 'number'), 'UnderlinePosition': (b'\x0c\x03', 'number'), 'UnderlineThickness': (b'\x0c\x04', 'number'), 'UniqueID': (b'\r', 'number'), 'VarStore': (b'\x18', 'number'), 'Weight': (b'\x04', 'SID'), 'XUID': (b'\x0e', 'array'), 'charset': (b'\x0f', 'number'), 'isFixedPitch': (b'\x0c\x01', 'number'), 'maxstack': (b'\x19', 'number'), 'version': (b'\x00', 'SID')}¶
-
-
class
fontTools.cffLib.
TopDictDecompiler
(strings, parent=None)[source]¶ -
operators
= {25: ('maxstack', 'number'), (12, 30): ('ROS', ('SID', 'SID', 'number')), (12, 20): ('SyntheticBase', 'number'), 0: ('version', 'SID'), 1: ('Notice', 'SID'), (12, 0): ('Copyright', 'SID'), 2: ('FullName', 'SID'), (12, 38): ('FontName', 'SID'), 3: ('FamilyName', 'SID'), 4: ('Weight', 'SID'), (12, 1): ('isFixedPitch', 'number'), (12, 2): ('ItalicAngle', 'number'), (12, 3): ('UnderlinePosition', 'number'), (12, 4): ('UnderlineThickness', 'number'), (12, 5): ('PaintType', 'number'), (12, 6): ('CharstringType', 'number'), (12, 7): ('FontMatrix', 'array'), 13: ('UniqueID', 'number'), 5: ('FontBBox', 'array'), (12, 8): ('StrokeWidth', 'number'), 14: ('XUID', 'array'), (12, 21): ('PostScript', 'SID'), (12, 22): ('BaseFontName', 'SID'), (12, 23): ('BaseFontBlend', 'delta'), (12, 31): ('CIDFontVersion', 'number'), (12, 32): ('CIDFontRevision', 'number'), (12, 33): ('CIDFontType', 'number'), (12, 34): ('CIDCount', 'number'), 15: ('charset', 'number'), (12, 35): ('UIDBase', 'number'), 16: ('Encoding', 'number'), 18: ('Private', ('number', 'number')), (12, 37): ('FDSelect', 'number'), (12, 36): ('FDArray', 'number'), 17: ('CharStrings', 'number'), 24: ('VarStore', 'number')}¶
-
-
class
fontTools.cffLib.
TopDictIndex
(file=None, cff2GetGlyphOrder=None, topSize=0, isCFF2=None)[source]¶ -
compilerClass
¶ alias of
TopDictIndexCompiler
-