Home
last modified time | relevance | path

Searched refs:ttFont (Results 1 – 25 of 44) sorted by relevance

12

/external/fonttools/Lib/fontTools/ttLib/tables/
D_p_o_s_t.py31 def decompile(self, data, ttFont): argument
35 self.decode_format_1_0(data, ttFont)
37 self.decode_format_2_0(data, ttFont)
39 self.decode_format_3_0(data, ttFont)
41 self.decode_format_4_0(data, ttFont)
46 def compile(self, ttFont): argument
51 data = data + self.encode_format_2_0(ttFont)
55 data = data + self.encode_format_4_0(ttFont)
72 def decode_format_1_0(self, data, ttFont): argument
73 self.glyphOrder = standardGlyphOrder[:ttFont["maxp"].numGlyphs]
[all …]
DE_B_L_C_.py70 def decompile(self, data, ttFont): argument
105 indexSubTable = indexFormatClass(data[indexSubHeaderSize:], ttFont)
114 def compile(self, ttFont): argument
173 glyphIds = list(map(ttFont.getGlyphID, indexSubTable.names))
176 data = indexSubTable.compile(ttFont)
202 def toXML(self, writer, ttFont): argument
206 curStrike.toXML(curIndex, writer, ttFont)
208 def fromXML(self, name, attrs, content, ttFont): argument
216 curStrike.fromXML(name, attrs, content, ttFont, self)
231 def toXML(self, strikeIndex, writer, ttFont): argument
[all …]
DE_B_D_T_.py34 def decompile(self, data, ttFont): argument
48 locator = ttFont[self.__class__.locatorName]
63 curGlyph = imageFormatClass(curGlyphData, ttFont)
67 def compile(self, ttFont): argument
83 locator = ttFont[self.__class__.locatorName]
100 data = glyph.compile(ttFont)
118 def toXML(self, writer, ttFont): argument
122 if ttFont.bitmapGlyphDataFormat in ('row', 'bitwise'):
123 locator = ttFont[self.__class__.locatorName]
138 locator = ttFont[self.__class__.locatorName]
[all …]
D_k_e_r_n.py19 def decompile(self, data, ttFont): argument
46 subtable.decompile(data[:length], ttFont)
50 def compile(self, ttFont): argument
62 data = data + subtable.compile(ttFont)
65 def toXML(self, writer, ttFont): argument
69 subtable.toXML(writer, ttFont)
71 def fromXML(self, name, attrs, content, ttFont): argument
85 subtable.fromXML(name, attrs, content, ttFont)
90 def decompile(self, data, ttFont): argument
113 kernTable[(ttFont.getGlyphName(left), ttFont.getGlyphName(right))] = value
[all …]
D_c_m_a_p.py22 def decompile(self, data, ttFont): argument
49 table.decompileHeader(data[offset:offset+int(length)], ttFont)
56 def compile(self, ttFont): argument
68 chunk = table.compile(ttFont)
77 def toXML(self, writer, ttFont): argument
81 table.toXML(writer, ttFont)
83 def fromXML(self, name, attrs, content, ttFont): argument
98 table.fromXML(name, attrs, content, ttFont)
107 self.ttFont = None
121 def decompileHeader(self, data, ttFont): argument
[all …]
D_h_h_e_a.py34 def decompile(self, data, ttFont): argument
37 def compile(self, ttFont): argument
38 if ttFont.isLoaded('glyf') and ttFont.recalcBBoxes:
39 self.recalc(ttFont)
42 def recalc(self, ttFont): argument
43 hmtxTable = ttFont['hmtx']
44 if 'glyf' in ttFont:
45 glyfTable = ttFont['glyf']
52 for name in ttFont.getGlyphOrder():
82 def toXML(self, writer, ttFont): argument
[all …]
D_v_h_e_a.py32 def decompile(self, data, ttFont): argument
35 def compile(self, ttFont): argument
36 self.recalc(ttFont)
39 def recalc(self, ttFont): argument
40 vtmxTable = ttFont['vmtx']
41 if 'glyf' in ttFont:
42 if not ttFont.isLoaded('glyf'):
44 glyfTable = ttFont['glyf']
50 for name in ttFont.getGlyphOrder():
69 def toXML(self, writer, ttFont): argument
[all …]
D_m_a_x_p.py35 def decompile(self, data, ttFont): argument
42 def compile(self, ttFont): argument
43 if 'glyf' in ttFont:
44 if ttFont.isLoaded('glyf') and ttFont.recalcBBoxes:
45 self.recalc(ttFont)
48 self.numGlyphs = len(ttFont.getGlyphOrder())
56 def recalc(self, ttFont): argument
61 glyfTable = ttFont['glyf']
62 hmtxTable = ttFont['hmtx']
63 headTable = ttFont['head']
[all …]
DC_O_L_R_.py20 def decompile(self, data, ttFont): argument
21 self.getGlyphName = ttFont.getGlyphName # for use in get/set item functions, for access by GID
24 glyphOrder = ttFont.getGlyphOrder()
55 def compile(self, ttFont): argument
57 ttFont.getReverseGlyphMap(rebuild=True)
61 gid = ttFont.getGlyphID(glyphName)
72 layerMap.append(struct.pack(">HH", ttFont.getGlyphID(layer.name), layer.colorID))
80 def toXML(self, writer, ttFont): argument
87 gid = ttFont.getGlyphID(glyphName)
96 layer.toXML(writer, ttFont)
[all …]
DV_O_R_G_.py16 def decompile(self, data, ttFont): argument
17 self.getGlyphName = ttFont.getGlyphName # for use in get/set item functions, for access by GID
31 glyphOrder = ttFont.getGlyphOrder()
41 def compile(self, ttFont): argument
44 nameMap = ttFont.getReverseGlyphMap()
49 nameMap = ttFont.getReverseGlyphMap(rebuild=True)
60 def toXML(self, writer, ttFont): argument
73 gid = ttFont.getGlyphID(glyphName)
80 vOriginRec.toXML(writer, ttFont)
82 def fromXML(self, name, attrs, content, ttFont): argument
[all …]
D_l_o_c_a.py12 def decompile(self, data, ttFont): argument
13 longFormat = ttFont['head'].indexToLocFormat
27 if len(locations) < (ttFont['maxp'].numGlyphs + 1):
28 …loca' table, or wrong numGlyphs in 'maxp': %d %d" % (len(locations) - 1, ttFont['maxp'].numGlyphs))
31 def compile(self, ttFont): argument
41 ttFont['head'].indexToLocFormat = 0
44 ttFont['head'].indexToLocFormat = 1
52 def toXML(self, writer, ttFont): argument
DsbixBitmapSet.py30 def decompile(self, ttFont): argument
58 myBitmap.decompile(ttFont)
63 def compile(self, ttFont): argument
67 glyphOrder = ttFont.getGlyphOrder()
78 myBitmap.compile(ttFont)
101 def toXML(self, xmlWriter, ttFont): argument
108 glyphOrder = ttFont.getGlyphOrder()
111 self.bitmaps[glyphOrder[i]].toXML(xmlWriter, ttFont)
116 def fromXML(self, name, attrs, content, ttFont): argument
133 myBitmap.fromXML(name, attrs, content, ttFont)
[all …]
DT_S_I__5.py11 def decompile(self, data, ttFont): argument
12 numGlyphs = ttFont['maxp'].numGlyphs
20 self.glyphGrouping[ttFont.getGlyphName(i)] = a[i]
22 def compile(self, ttFont): argument
23 glyphNames = ttFont.getGlyphOrder()
31 def toXML(self, writer, ttFont): argument
37 def fromXML(self, name, attrs, content, ttFont): argument
D_h_m_t_x.py17 def decompile(self, data, ttFont): argument
18 numGlyphs = ttFont['maxp'].numGlyphs
19 numberOfMetrics = int(getattr(ttFont[self.headerTag], self.numberOfMetricsName))
36 glyphOrder = ttFont.getGlyphOrder()
45 def compile(self, ttFont): argument
47 for glyphName in ttFont.getGlyphOrder():
60 setattr(ttFont[self.headerTag], self.numberOfMetricsName, len(metrics))
76 def toXML(self, writer, ttFont): argument
87 def fromXML(self, name, attrs, content, ttFont): argument
D_f_p_g_m.py8 def decompile(self, data, ttFont): argument
13 def compile(self, ttFont): argument
16 def toXML(self, writer, ttFont): argument
17 self.program.toXML(writer, ttFont)
20 def fromXML(self, name, attrs, content, ttFont): argument
22 program.fromXML(name, attrs, content, ttFont)
DG_M_A_P_.py38 def toXML(self, writer, ttFont): argument
55 def fromXML(self, name, attrs, content, ttFont): argument
63 def compile(self, ttFont): argument
80 def decompile(self, data, ttFont): argument
92 def compile(self, ttFont): argument
100 data = data + record.compile(ttFont)
104 def toXML(self, writer, ttFont): argument
115 gmapRecord.toXML(writer, ttFont)
117 def fromXML(self, name, attrs, content, ttFont): argument
127 gmapRecord.fromXML(name, attrs, content, ttFont)
DsbixBitmap.py29 def decompile(self, ttFont): argument
30 self.glyphName = ttFont.getGlyphName(self.gid)
45 self.referenceGlyphName = ttFont.getGlyphName(gid)
53 def compile(self, ttFont): argument
59 self.gid = struct.pack(">H", ttFont.getGlyphID(self.glyphName))
65 def toXML(self, xmlWriter, ttFont): argument
91 def fromXML(self, name, attrs, content, ttFont): argument
99 self.imageData = struct.pack(">H", ttFont.getGlyphID(attrs["glyphname"]))
D_h_d_m_x.py15 def decompile(self, data, ttFont): argument
16 numGlyphs = ttFont['maxp'].numGlyphs
17 glyphOrder = ttFont.getGlyphOrder()
30 def compile(self, ttFont): argument
32 numGlyphs = ttFont['maxp'].numGlyphs
33 glyphOrder = ttFont.getGlyphOrder()
47 def toXML(self, writer, ttFont): argument
57 glyphNames = ttFont.getGlyphOrder()[:]
76 def fromXML(self, name, attrs, content, ttFont): argument
DS_V_G_.py97 def decompile(self, data, ttFont): argument
104 self.decompile_format_1(data, ttFont)
108 self.decompile_format_0(data, ttFont)
111 def decompile_format_0(self, data, ttFont): argument
150 def decompile_format_1(self, data, ttFont): argument
177 def compile(self, ttFont): argument
179 data = self.compileFormat1(ttFont)
181 data = self.compileFormat0(ttFont)
184 def compileFormat0(self, ttFont): argument
233 def compileFormat1(self, ttFont): argument
[all …]
D_s_b_i_x.py70 def decompile(self, data, ttFont): argument
86 myBitmapSet.decompile(ttFont)
97 def compile(self, ttFont): argument
107 myBitmapSet.compile(ttFont)
116 def toXML(self, xmlWriter, ttFont): argument
122 self.bitmapSets[i].toXML(xmlWriter, ttFont)
124 def fromXML(self, name, attrs, content, ttFont): argument
132 myBitmapSet.fromXML(name, attrs, content, ttFont)
DDefaultTable.py14 def decompile(self, data, ttFont): argument
17 def compile(self, ttFont): argument
20 def toXML(self, writer, ttFont, progress=None): argument
28 writer.dumphex(self.compile(ttFont))
32 def fromXML(self, name, attrs, content, ttFont): argument
37 self.decompile(readHex(content), ttFont)
DL_T_S_H_.py14 def decompile(self, data, ttFont): argument
25 self.yPels[ttFont.getGlyphName(i)] = yPels[i]
27 def compile(self, ttFont): argument
35 yPels[ttFont.getGlyphID(name)] = self.yPels[name]
39 def toXML(self, writer, ttFont): argument
45 def fromXML(self, name, attrs, content, ttFont): argument
DC_P_A_L_.py14 def decompile(self, data, ttFont): argument
30 def compile(self, ttFont): argument
41 def toXML(self, writer, ttFont): argument
51 color.toXML(writer, ttFont, cindex)
55 def fromXML(self, name, attrs, content, ttFont): argument
68 color.fromXML(element[0], element[1], element[2], ttFont)
89 def toXML(self, writer, ttFont, index=None): argument
93 def fromXML(self, eltname, attrs, content, ttFont): argument
/external/fonttools/Lib/fontTools/ttLib/
DmacUtils.py81 def __init__(self, path, ttFont, res_id=None): argument
85 fullname = ttFont['name'].getName(4, 1, 0) # Full name, mac, default encoding
86 familyname = ttFont['name'].getName(1, 1, 0) # Fam. name, mac, default encoding
87 psname = ttFont['name'].getName(6, 1, 0) # PostScript name, etc.
102 self.ttFont = ttFont
127 del self.ttFont
161 scale = 4096 / self.ttFont['head'].unitsPerEm
162 fond.ffAscent = scale * self.ttFont['hhea'].ascent
163 fond.ffDescent = scale * self.ttFont['hhea'].descent
164 fond.ffWidMax = scale * self.ttFont['hhea'].advanceWidthMax
[all …]
/external/fonttools/Lib/fontTools/misc/
DxmlReader.py16 def __init__(self, fileName, ttFont, progress=None, quiet=False): argument
17 self.ttFont = ttFont
61 self.ttFont.sfntVersion = sfntVersion
67 subReader = XMLReader(subFile, self.ttFont, self.progress, self.quiet)
75 elif self.ttFont.verbose:
88 if tag == 'loca' and tag in self.ttFont:
91 self.currentTable = self.ttFont[tag]
94 self.ttFont[tag] = self.currentTable
115 self.currentTable.fromXML(name, attrs, content, self.ttFont)

12