fonttools 4.60.2__cp311-cp311-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fontTools/__init__.py +8 -0
- fontTools/__main__.py +35 -0
- fontTools/afmLib.py +439 -0
- fontTools/agl.py +5233 -0
- fontTools/annotations.py +30 -0
- fontTools/cffLib/CFF2ToCFF.py +258 -0
- fontTools/cffLib/CFFToCFF2.py +305 -0
- fontTools/cffLib/__init__.py +3694 -0
- fontTools/cffLib/specializer.py +927 -0
- fontTools/cffLib/transforms.py +495 -0
- fontTools/cffLib/width.py +210 -0
- fontTools/colorLib/__init__.py +0 -0
- fontTools/colorLib/builder.py +664 -0
- fontTools/colorLib/errors.py +2 -0
- fontTools/colorLib/geometry.py +143 -0
- fontTools/colorLib/table_builder.py +223 -0
- fontTools/colorLib/unbuilder.py +81 -0
- fontTools/config/__init__.py +90 -0
- fontTools/cu2qu/__init__.py +15 -0
- fontTools/cu2qu/__main__.py +6 -0
- fontTools/cu2qu/benchmark.py +54 -0
- fontTools/cu2qu/cli.py +198 -0
- fontTools/cu2qu/cu2qu.c +15817 -0
- fontTools/cu2qu/cu2qu.cp311-win32.pyd +0 -0
- fontTools/cu2qu/cu2qu.py +563 -0
- fontTools/cu2qu/errors.py +77 -0
- fontTools/cu2qu/ufo.py +363 -0
- fontTools/designspaceLib/__init__.py +3343 -0
- fontTools/designspaceLib/__main__.py +6 -0
- fontTools/designspaceLib/split.py +475 -0
- fontTools/designspaceLib/statNames.py +260 -0
- fontTools/designspaceLib/types.py +147 -0
- fontTools/encodings/MacRoman.py +258 -0
- fontTools/encodings/StandardEncoding.py +258 -0
- fontTools/encodings/__init__.py +1 -0
- fontTools/encodings/codecs.py +135 -0
- fontTools/feaLib/__init__.py +4 -0
- fontTools/feaLib/__main__.py +78 -0
- fontTools/feaLib/ast.py +2143 -0
- fontTools/feaLib/builder.py +1814 -0
- fontTools/feaLib/error.py +22 -0
- fontTools/feaLib/lexer.c +17029 -0
- fontTools/feaLib/lexer.cp311-win32.pyd +0 -0
- fontTools/feaLib/lexer.py +287 -0
- fontTools/feaLib/location.py +12 -0
- fontTools/feaLib/lookupDebugInfo.py +12 -0
- fontTools/feaLib/parser.py +2394 -0
- fontTools/feaLib/variableScalar.py +118 -0
- fontTools/fontBuilder.py +1014 -0
- fontTools/help.py +36 -0
- fontTools/merge/__init__.py +248 -0
- fontTools/merge/__main__.py +6 -0
- fontTools/merge/base.py +81 -0
- fontTools/merge/cmap.py +173 -0
- fontTools/merge/layout.py +526 -0
- fontTools/merge/options.py +85 -0
- fontTools/merge/tables.py +352 -0
- fontTools/merge/unicode.py +78 -0
- fontTools/merge/util.py +143 -0
- fontTools/misc/__init__.py +1 -0
- fontTools/misc/arrayTools.py +424 -0
- fontTools/misc/bezierTools.c +39731 -0
- fontTools/misc/bezierTools.cp311-win32.pyd +0 -0
- fontTools/misc/bezierTools.py +1500 -0
- fontTools/misc/classifyTools.py +170 -0
- fontTools/misc/cliTools.py +53 -0
- fontTools/misc/configTools.py +349 -0
- fontTools/misc/cython.py +27 -0
- fontTools/misc/dictTools.py +83 -0
- fontTools/misc/eexec.py +119 -0
- fontTools/misc/encodingTools.py +72 -0
- fontTools/misc/enumTools.py +23 -0
- fontTools/misc/etree.py +456 -0
- fontTools/misc/filenames.py +245 -0
- fontTools/misc/filesystem/__init__.py +68 -0
- fontTools/misc/filesystem/_base.py +134 -0
- fontTools/misc/filesystem/_copy.py +45 -0
- fontTools/misc/filesystem/_errors.py +54 -0
- fontTools/misc/filesystem/_info.py +75 -0
- fontTools/misc/filesystem/_osfs.py +164 -0
- fontTools/misc/filesystem/_path.py +67 -0
- fontTools/misc/filesystem/_subfs.py +92 -0
- fontTools/misc/filesystem/_tempfs.py +34 -0
- fontTools/misc/filesystem/_tools.py +34 -0
- fontTools/misc/filesystem/_walk.py +55 -0
- fontTools/misc/filesystem/_zipfs.py +204 -0
- fontTools/misc/fixedTools.py +253 -0
- fontTools/misc/intTools.py +25 -0
- fontTools/misc/iterTools.py +12 -0
- fontTools/misc/lazyTools.py +42 -0
- fontTools/misc/loggingTools.py +543 -0
- fontTools/misc/macCreatorType.py +56 -0
- fontTools/misc/macRes.py +261 -0
- fontTools/misc/plistlib/__init__.py +681 -0
- fontTools/misc/plistlib/py.typed +0 -0
- fontTools/misc/psCharStrings.py +1511 -0
- fontTools/misc/psLib.py +398 -0
- fontTools/misc/psOperators.py +572 -0
- fontTools/misc/py23.py +96 -0
- fontTools/misc/roundTools.py +110 -0
- fontTools/misc/sstruct.py +227 -0
- fontTools/misc/symfont.py +242 -0
- fontTools/misc/testTools.py +233 -0
- fontTools/misc/textTools.py +156 -0
- fontTools/misc/timeTools.py +88 -0
- fontTools/misc/transform.py +516 -0
- fontTools/misc/treeTools.py +45 -0
- fontTools/misc/vector.py +147 -0
- fontTools/misc/visitor.py +158 -0
- fontTools/misc/xmlReader.py +188 -0
- fontTools/misc/xmlWriter.py +231 -0
- fontTools/mtiLib/__init__.py +1400 -0
- fontTools/mtiLib/__main__.py +5 -0
- fontTools/otlLib/__init__.py +1 -0
- fontTools/otlLib/builder.py +3465 -0
- fontTools/otlLib/error.py +11 -0
- fontTools/otlLib/maxContextCalc.py +96 -0
- fontTools/otlLib/optimize/__init__.py +53 -0
- fontTools/otlLib/optimize/__main__.py +6 -0
- fontTools/otlLib/optimize/gpos.py +439 -0
- fontTools/pens/__init__.py +1 -0
- fontTools/pens/areaPen.py +52 -0
- fontTools/pens/basePen.py +475 -0
- fontTools/pens/boundsPen.py +98 -0
- fontTools/pens/cairoPen.py +26 -0
- fontTools/pens/cocoaPen.py +26 -0
- fontTools/pens/cu2quPen.py +325 -0
- fontTools/pens/explicitClosingLinePen.py +101 -0
- fontTools/pens/filterPen.py +433 -0
- fontTools/pens/freetypePen.py +462 -0
- fontTools/pens/hashPointPen.py +89 -0
- fontTools/pens/momentsPen.c +13378 -0
- fontTools/pens/momentsPen.cp311-win32.pyd +0 -0
- fontTools/pens/momentsPen.py +879 -0
- fontTools/pens/perimeterPen.py +69 -0
- fontTools/pens/pointInsidePen.py +192 -0
- fontTools/pens/pointPen.py +643 -0
- fontTools/pens/qtPen.py +29 -0
- fontTools/pens/qu2cuPen.py +105 -0
- fontTools/pens/quartzPen.py +43 -0
- fontTools/pens/recordingPen.py +335 -0
- fontTools/pens/reportLabPen.py +79 -0
- fontTools/pens/reverseContourPen.py +96 -0
- fontTools/pens/roundingPen.py +130 -0
- fontTools/pens/statisticsPen.py +312 -0
- fontTools/pens/svgPathPen.py +310 -0
- fontTools/pens/t2CharStringPen.py +88 -0
- fontTools/pens/teePen.py +55 -0
- fontTools/pens/transformPen.py +115 -0
- fontTools/pens/ttGlyphPen.py +335 -0
- fontTools/pens/wxPen.py +29 -0
- fontTools/qu2cu/__init__.py +15 -0
- fontTools/qu2cu/__main__.py +7 -0
- fontTools/qu2cu/benchmark.py +56 -0
- fontTools/qu2cu/cli.py +125 -0
- fontTools/qu2cu/qu2cu.c +16682 -0
- fontTools/qu2cu/qu2cu.cp311-win32.pyd +0 -0
- fontTools/qu2cu/qu2cu.py +405 -0
- fontTools/subset/__init__.py +4096 -0
- fontTools/subset/__main__.py +6 -0
- fontTools/subset/cff.py +184 -0
- fontTools/subset/svg.py +253 -0
- fontTools/subset/util.py +25 -0
- fontTools/svgLib/__init__.py +3 -0
- fontTools/svgLib/path/__init__.py +65 -0
- fontTools/svgLib/path/arc.py +154 -0
- fontTools/svgLib/path/parser.py +322 -0
- fontTools/svgLib/path/shapes.py +183 -0
- fontTools/t1Lib/__init__.py +648 -0
- fontTools/tfmLib.py +460 -0
- fontTools/ttLib/__init__.py +30 -0
- fontTools/ttLib/__main__.py +148 -0
- fontTools/ttLib/macUtils.py +54 -0
- fontTools/ttLib/removeOverlaps.py +395 -0
- fontTools/ttLib/reorderGlyphs.py +285 -0
- fontTools/ttLib/scaleUpem.py +436 -0
- fontTools/ttLib/sfnt.py +661 -0
- fontTools/ttLib/standardGlyphOrder.py +271 -0
- fontTools/ttLib/tables/B_A_S_E_.py +14 -0
- fontTools/ttLib/tables/BitmapGlyphMetrics.py +64 -0
- fontTools/ttLib/tables/C_B_D_T_.py +113 -0
- fontTools/ttLib/tables/C_B_L_C_.py +19 -0
- fontTools/ttLib/tables/C_F_F_.py +61 -0
- fontTools/ttLib/tables/C_F_F__2.py +26 -0
- fontTools/ttLib/tables/C_O_L_R_.py +165 -0
- fontTools/ttLib/tables/C_P_A_L_.py +305 -0
- fontTools/ttLib/tables/D_S_I_G_.py +158 -0
- fontTools/ttLib/tables/D__e_b_g.py +35 -0
- fontTools/ttLib/tables/DefaultTable.py +49 -0
- fontTools/ttLib/tables/E_B_D_T_.py +835 -0
- fontTools/ttLib/tables/E_B_L_C_.py +718 -0
- fontTools/ttLib/tables/F_F_T_M_.py +52 -0
- fontTools/ttLib/tables/F__e_a_t.py +149 -0
- fontTools/ttLib/tables/G_D_E_F_.py +13 -0
- fontTools/ttLib/tables/G_M_A_P_.py +148 -0
- fontTools/ttLib/tables/G_P_K_G_.py +133 -0
- fontTools/ttLib/tables/G_P_O_S_.py +14 -0
- fontTools/ttLib/tables/G_S_U_B_.py +13 -0
- fontTools/ttLib/tables/G_V_A_R_.py +5 -0
- fontTools/ttLib/tables/G__l_a_t.py +235 -0
- fontTools/ttLib/tables/G__l_o_c.py +85 -0
- fontTools/ttLib/tables/H_V_A_R_.py +13 -0
- fontTools/ttLib/tables/J_S_T_F_.py +13 -0
- fontTools/ttLib/tables/L_T_S_H_.py +58 -0
- fontTools/ttLib/tables/M_A_T_H_.py +13 -0
- fontTools/ttLib/tables/M_E_T_A_.py +352 -0
- fontTools/ttLib/tables/M_V_A_R_.py +13 -0
- fontTools/ttLib/tables/O_S_2f_2.py +752 -0
- fontTools/ttLib/tables/S_I_N_G_.py +99 -0
- fontTools/ttLib/tables/S_T_A_T_.py +15 -0
- fontTools/ttLib/tables/S_V_G_.py +223 -0
- fontTools/ttLib/tables/S__i_l_f.py +1040 -0
- fontTools/ttLib/tables/S__i_l_l.py +92 -0
- fontTools/ttLib/tables/T_S_I_B_.py +13 -0
- fontTools/ttLib/tables/T_S_I_C_.py +14 -0
- fontTools/ttLib/tables/T_S_I_D_.py +13 -0
- fontTools/ttLib/tables/T_S_I_J_.py +13 -0
- fontTools/ttLib/tables/T_S_I_P_.py +13 -0
- fontTools/ttLib/tables/T_S_I_S_.py +13 -0
- fontTools/ttLib/tables/T_S_I_V_.py +26 -0
- fontTools/ttLib/tables/T_S_I__0.py +70 -0
- fontTools/ttLib/tables/T_S_I__1.py +163 -0
- fontTools/ttLib/tables/T_S_I__2.py +17 -0
- fontTools/ttLib/tables/T_S_I__3.py +22 -0
- fontTools/ttLib/tables/T_S_I__5.py +60 -0
- fontTools/ttLib/tables/T_T_F_A_.py +14 -0
- fontTools/ttLib/tables/TupleVariation.py +884 -0
- fontTools/ttLib/tables/V_A_R_C_.py +12 -0
- fontTools/ttLib/tables/V_D_M_X_.py +249 -0
- fontTools/ttLib/tables/V_O_R_G_.py +165 -0
- fontTools/ttLib/tables/V_V_A_R_.py +13 -0
- fontTools/ttLib/tables/__init__.py +98 -0
- fontTools/ttLib/tables/_a_n_k_r.py +15 -0
- fontTools/ttLib/tables/_a_v_a_r.py +193 -0
- fontTools/ttLib/tables/_b_s_l_n.py +15 -0
- fontTools/ttLib/tables/_c_i_d_g.py +24 -0
- fontTools/ttLib/tables/_c_m_a_p.py +1591 -0
- fontTools/ttLib/tables/_c_v_a_r.py +94 -0
- fontTools/ttLib/tables/_c_v_t.py +56 -0
- fontTools/ttLib/tables/_f_e_a_t.py +15 -0
- fontTools/ttLib/tables/_f_p_g_m.py +62 -0
- fontTools/ttLib/tables/_f_v_a_r.py +261 -0
- fontTools/ttLib/tables/_g_a_s_p.py +63 -0
- fontTools/ttLib/tables/_g_c_i_d.py +13 -0
- fontTools/ttLib/tables/_g_l_y_f.py +2311 -0
- fontTools/ttLib/tables/_g_v_a_r.py +340 -0
- fontTools/ttLib/tables/_h_d_m_x.py +127 -0
- fontTools/ttLib/tables/_h_e_a_d.py +130 -0
- fontTools/ttLib/tables/_h_h_e_a.py +147 -0
- fontTools/ttLib/tables/_h_m_t_x.py +164 -0
- fontTools/ttLib/tables/_k_e_r_n.py +289 -0
- fontTools/ttLib/tables/_l_c_a_r.py +13 -0
- fontTools/ttLib/tables/_l_o_c_a.py +70 -0
- fontTools/ttLib/tables/_l_t_a_g.py +72 -0
- fontTools/ttLib/tables/_m_a_x_p.py +147 -0
- fontTools/ttLib/tables/_m_e_t_a.py +112 -0
- fontTools/ttLib/tables/_m_o_r_t.py +14 -0
- fontTools/ttLib/tables/_m_o_r_x.py +15 -0
- fontTools/ttLib/tables/_n_a_m_e.py +1242 -0
- fontTools/ttLib/tables/_o_p_b_d.py +14 -0
- fontTools/ttLib/tables/_p_o_s_t.py +319 -0
- fontTools/ttLib/tables/_p_r_e_p.py +16 -0
- fontTools/ttLib/tables/_p_r_o_p.py +12 -0
- fontTools/ttLib/tables/_s_b_i_x.py +129 -0
- fontTools/ttLib/tables/_t_r_a_k.py +332 -0
- fontTools/ttLib/tables/_v_h_e_a.py +139 -0
- fontTools/ttLib/tables/_v_m_t_x.py +19 -0
- fontTools/ttLib/tables/asciiTable.py +20 -0
- fontTools/ttLib/tables/grUtils.py +92 -0
- fontTools/ttLib/tables/otBase.py +1458 -0
- fontTools/ttLib/tables/otConverters.py +2068 -0
- fontTools/ttLib/tables/otData.py +6400 -0
- fontTools/ttLib/tables/otTables.py +2703 -0
- fontTools/ttLib/tables/otTraverse.py +163 -0
- fontTools/ttLib/tables/sbixGlyph.py +149 -0
- fontTools/ttLib/tables/sbixStrike.py +177 -0
- fontTools/ttLib/tables/table_API_readme.txt +91 -0
- fontTools/ttLib/tables/ttProgram.py +594 -0
- fontTools/ttLib/ttCollection.py +125 -0
- fontTools/ttLib/ttFont.py +1148 -0
- fontTools/ttLib/ttGlyphSet.py +490 -0
- fontTools/ttLib/ttVisitor.py +32 -0
- fontTools/ttLib/woff2.py +1680 -0
- fontTools/ttx.py +479 -0
- fontTools/ufoLib/__init__.py +2575 -0
- fontTools/ufoLib/converters.py +407 -0
- fontTools/ufoLib/errors.py +30 -0
- fontTools/ufoLib/etree.py +6 -0
- fontTools/ufoLib/filenames.py +356 -0
- fontTools/ufoLib/glifLib.py +2120 -0
- fontTools/ufoLib/kerning.py +141 -0
- fontTools/ufoLib/plistlib.py +47 -0
- fontTools/ufoLib/pointPen.py +6 -0
- fontTools/ufoLib/utils.py +107 -0
- fontTools/ufoLib/validators.py +1208 -0
- fontTools/unicode.py +50 -0
- fontTools/unicodedata/Blocks.py +817 -0
- fontTools/unicodedata/Mirrored.py +446 -0
- fontTools/unicodedata/OTTags.py +50 -0
- fontTools/unicodedata/ScriptExtensions.py +832 -0
- fontTools/unicodedata/Scripts.py +3639 -0
- fontTools/unicodedata/__init__.py +306 -0
- fontTools/varLib/__init__.py +1600 -0
- fontTools/varLib/__main__.py +6 -0
- fontTools/varLib/avar/__init__.py +0 -0
- fontTools/varLib/avar/__main__.py +72 -0
- fontTools/varLib/avar/build.py +79 -0
- fontTools/varLib/avar/map.py +108 -0
- fontTools/varLib/avar/plan.py +1004 -0
- fontTools/varLib/avar/unbuild.py +271 -0
- fontTools/varLib/avarPlanner.py +8 -0
- fontTools/varLib/builder.py +215 -0
- fontTools/varLib/cff.py +631 -0
- fontTools/varLib/errors.py +219 -0
- fontTools/varLib/featureVars.py +703 -0
- fontTools/varLib/hvar.py +113 -0
- fontTools/varLib/instancer/__init__.py +2052 -0
- fontTools/varLib/instancer/__main__.py +5 -0
- fontTools/varLib/instancer/featureVars.py +190 -0
- fontTools/varLib/instancer/names.py +388 -0
- fontTools/varLib/instancer/solver.py +309 -0
- fontTools/varLib/interpolatable.py +1209 -0
- fontTools/varLib/interpolatableHelpers.py +399 -0
- fontTools/varLib/interpolatablePlot.py +1269 -0
- fontTools/varLib/interpolatableTestContourOrder.py +82 -0
- fontTools/varLib/interpolatableTestStartingPoint.py +107 -0
- fontTools/varLib/interpolate_layout.py +124 -0
- fontTools/varLib/iup.c +19815 -0
- fontTools/varLib/iup.cp311-win32.pyd +0 -0
- fontTools/varLib/iup.py +490 -0
- fontTools/varLib/merger.py +1717 -0
- fontTools/varLib/models.py +642 -0
- fontTools/varLib/multiVarStore.py +253 -0
- fontTools/varLib/mutator.py +529 -0
- fontTools/varLib/mvar.py +40 -0
- fontTools/varLib/plot.py +238 -0
- fontTools/varLib/stat.py +149 -0
- fontTools/varLib/varStore.py +739 -0
- fontTools/voltLib/__init__.py +5 -0
- fontTools/voltLib/__main__.py +206 -0
- fontTools/voltLib/ast.py +452 -0
- fontTools/voltLib/error.py +12 -0
- fontTools/voltLib/lexer.py +99 -0
- fontTools/voltLib/parser.py +664 -0
- fontTools/voltLib/voltToFea.py +911 -0
- fonttools-4.60.2.data/data/share/man/man1/ttx.1 +225 -0
- fonttools-4.60.2.dist-info/METADATA +2250 -0
- fonttools-4.60.2.dist-info/RECORD +353 -0
- fonttools-4.60.2.dist-info/WHEEL +5 -0
- fonttools-4.60.2.dist-info/entry_points.txt +5 -0
- fonttools-4.60.2.dist-info/licenses/LICENSE +21 -0
- fonttools-4.60.2.dist-info/licenses/LICENSE.external +388 -0
- fonttools-4.60.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
#
|
|
2
|
+
# 'post' table formats 1.0 and 2.0 rely on this list of "standard"
|
|
3
|
+
# glyphs.
|
|
4
|
+
#
|
|
5
|
+
# My list is correct according to the Apple documentation for the 'post' table:
|
|
6
|
+
# https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6post.html
|
|
7
|
+
# (However, it seems that TTFdump (from MS) and FontLab disagree, at
|
|
8
|
+
# least with respect to the last glyph, which they list as 'dslash'
|
|
9
|
+
# instead of 'dcroat'.)
|
|
10
|
+
#
|
|
11
|
+
|
|
12
|
+
standardGlyphOrder = [
|
|
13
|
+
".notdef", # 0
|
|
14
|
+
".null", # 1
|
|
15
|
+
"nonmarkingreturn", # 2
|
|
16
|
+
"space", # 3
|
|
17
|
+
"exclam", # 4
|
|
18
|
+
"quotedbl", # 5
|
|
19
|
+
"numbersign", # 6
|
|
20
|
+
"dollar", # 7
|
|
21
|
+
"percent", # 8
|
|
22
|
+
"ampersand", # 9
|
|
23
|
+
"quotesingle", # 10
|
|
24
|
+
"parenleft", # 11
|
|
25
|
+
"parenright", # 12
|
|
26
|
+
"asterisk", # 13
|
|
27
|
+
"plus", # 14
|
|
28
|
+
"comma", # 15
|
|
29
|
+
"hyphen", # 16
|
|
30
|
+
"period", # 17
|
|
31
|
+
"slash", # 18
|
|
32
|
+
"zero", # 19
|
|
33
|
+
"one", # 20
|
|
34
|
+
"two", # 21
|
|
35
|
+
"three", # 22
|
|
36
|
+
"four", # 23
|
|
37
|
+
"five", # 24
|
|
38
|
+
"six", # 25
|
|
39
|
+
"seven", # 26
|
|
40
|
+
"eight", # 27
|
|
41
|
+
"nine", # 28
|
|
42
|
+
"colon", # 29
|
|
43
|
+
"semicolon", # 30
|
|
44
|
+
"less", # 31
|
|
45
|
+
"equal", # 32
|
|
46
|
+
"greater", # 33
|
|
47
|
+
"question", # 34
|
|
48
|
+
"at", # 35
|
|
49
|
+
"A", # 36
|
|
50
|
+
"B", # 37
|
|
51
|
+
"C", # 38
|
|
52
|
+
"D", # 39
|
|
53
|
+
"E", # 40
|
|
54
|
+
"F", # 41
|
|
55
|
+
"G", # 42
|
|
56
|
+
"H", # 43
|
|
57
|
+
"I", # 44
|
|
58
|
+
"J", # 45
|
|
59
|
+
"K", # 46
|
|
60
|
+
"L", # 47
|
|
61
|
+
"M", # 48
|
|
62
|
+
"N", # 49
|
|
63
|
+
"O", # 50
|
|
64
|
+
"P", # 51
|
|
65
|
+
"Q", # 52
|
|
66
|
+
"R", # 53
|
|
67
|
+
"S", # 54
|
|
68
|
+
"T", # 55
|
|
69
|
+
"U", # 56
|
|
70
|
+
"V", # 57
|
|
71
|
+
"W", # 58
|
|
72
|
+
"X", # 59
|
|
73
|
+
"Y", # 60
|
|
74
|
+
"Z", # 61
|
|
75
|
+
"bracketleft", # 62
|
|
76
|
+
"backslash", # 63
|
|
77
|
+
"bracketright", # 64
|
|
78
|
+
"asciicircum", # 65
|
|
79
|
+
"underscore", # 66
|
|
80
|
+
"grave", # 67
|
|
81
|
+
"a", # 68
|
|
82
|
+
"b", # 69
|
|
83
|
+
"c", # 70
|
|
84
|
+
"d", # 71
|
|
85
|
+
"e", # 72
|
|
86
|
+
"f", # 73
|
|
87
|
+
"g", # 74
|
|
88
|
+
"h", # 75
|
|
89
|
+
"i", # 76
|
|
90
|
+
"j", # 77
|
|
91
|
+
"k", # 78
|
|
92
|
+
"l", # 79
|
|
93
|
+
"m", # 80
|
|
94
|
+
"n", # 81
|
|
95
|
+
"o", # 82
|
|
96
|
+
"p", # 83
|
|
97
|
+
"q", # 84
|
|
98
|
+
"r", # 85
|
|
99
|
+
"s", # 86
|
|
100
|
+
"t", # 87
|
|
101
|
+
"u", # 88
|
|
102
|
+
"v", # 89
|
|
103
|
+
"w", # 90
|
|
104
|
+
"x", # 91
|
|
105
|
+
"y", # 92
|
|
106
|
+
"z", # 93
|
|
107
|
+
"braceleft", # 94
|
|
108
|
+
"bar", # 95
|
|
109
|
+
"braceright", # 96
|
|
110
|
+
"asciitilde", # 97
|
|
111
|
+
"Adieresis", # 98
|
|
112
|
+
"Aring", # 99
|
|
113
|
+
"Ccedilla", # 100
|
|
114
|
+
"Eacute", # 101
|
|
115
|
+
"Ntilde", # 102
|
|
116
|
+
"Odieresis", # 103
|
|
117
|
+
"Udieresis", # 104
|
|
118
|
+
"aacute", # 105
|
|
119
|
+
"agrave", # 106
|
|
120
|
+
"acircumflex", # 107
|
|
121
|
+
"adieresis", # 108
|
|
122
|
+
"atilde", # 109
|
|
123
|
+
"aring", # 110
|
|
124
|
+
"ccedilla", # 111
|
|
125
|
+
"eacute", # 112
|
|
126
|
+
"egrave", # 113
|
|
127
|
+
"ecircumflex", # 114
|
|
128
|
+
"edieresis", # 115
|
|
129
|
+
"iacute", # 116
|
|
130
|
+
"igrave", # 117
|
|
131
|
+
"icircumflex", # 118
|
|
132
|
+
"idieresis", # 119
|
|
133
|
+
"ntilde", # 120
|
|
134
|
+
"oacute", # 121
|
|
135
|
+
"ograve", # 122
|
|
136
|
+
"ocircumflex", # 123
|
|
137
|
+
"odieresis", # 124
|
|
138
|
+
"otilde", # 125
|
|
139
|
+
"uacute", # 126
|
|
140
|
+
"ugrave", # 127
|
|
141
|
+
"ucircumflex", # 128
|
|
142
|
+
"udieresis", # 129
|
|
143
|
+
"dagger", # 130
|
|
144
|
+
"degree", # 131
|
|
145
|
+
"cent", # 132
|
|
146
|
+
"sterling", # 133
|
|
147
|
+
"section", # 134
|
|
148
|
+
"bullet", # 135
|
|
149
|
+
"paragraph", # 136
|
|
150
|
+
"germandbls", # 137
|
|
151
|
+
"registered", # 138
|
|
152
|
+
"copyright", # 139
|
|
153
|
+
"trademark", # 140
|
|
154
|
+
"acute", # 141
|
|
155
|
+
"dieresis", # 142
|
|
156
|
+
"notequal", # 143
|
|
157
|
+
"AE", # 144
|
|
158
|
+
"Oslash", # 145
|
|
159
|
+
"infinity", # 146
|
|
160
|
+
"plusminus", # 147
|
|
161
|
+
"lessequal", # 148
|
|
162
|
+
"greaterequal", # 149
|
|
163
|
+
"yen", # 150
|
|
164
|
+
"mu", # 151
|
|
165
|
+
"partialdiff", # 152
|
|
166
|
+
"summation", # 153
|
|
167
|
+
"product", # 154
|
|
168
|
+
"pi", # 155
|
|
169
|
+
"integral", # 156
|
|
170
|
+
"ordfeminine", # 157
|
|
171
|
+
"ordmasculine", # 158
|
|
172
|
+
"Omega", # 159
|
|
173
|
+
"ae", # 160
|
|
174
|
+
"oslash", # 161
|
|
175
|
+
"questiondown", # 162
|
|
176
|
+
"exclamdown", # 163
|
|
177
|
+
"logicalnot", # 164
|
|
178
|
+
"radical", # 165
|
|
179
|
+
"florin", # 166
|
|
180
|
+
"approxequal", # 167
|
|
181
|
+
"Delta", # 168
|
|
182
|
+
"guillemotleft", # 169
|
|
183
|
+
"guillemotright", # 170
|
|
184
|
+
"ellipsis", # 171
|
|
185
|
+
"nonbreakingspace", # 172
|
|
186
|
+
"Agrave", # 173
|
|
187
|
+
"Atilde", # 174
|
|
188
|
+
"Otilde", # 175
|
|
189
|
+
"OE", # 176
|
|
190
|
+
"oe", # 177
|
|
191
|
+
"endash", # 178
|
|
192
|
+
"emdash", # 179
|
|
193
|
+
"quotedblleft", # 180
|
|
194
|
+
"quotedblright", # 181
|
|
195
|
+
"quoteleft", # 182
|
|
196
|
+
"quoteright", # 183
|
|
197
|
+
"divide", # 184
|
|
198
|
+
"lozenge", # 185
|
|
199
|
+
"ydieresis", # 186
|
|
200
|
+
"Ydieresis", # 187
|
|
201
|
+
"fraction", # 188
|
|
202
|
+
"currency", # 189
|
|
203
|
+
"guilsinglleft", # 190
|
|
204
|
+
"guilsinglright", # 191
|
|
205
|
+
"fi", # 192
|
|
206
|
+
"fl", # 193
|
|
207
|
+
"daggerdbl", # 194
|
|
208
|
+
"periodcentered", # 195
|
|
209
|
+
"quotesinglbase", # 196
|
|
210
|
+
"quotedblbase", # 197
|
|
211
|
+
"perthousand", # 198
|
|
212
|
+
"Acircumflex", # 199
|
|
213
|
+
"Ecircumflex", # 200
|
|
214
|
+
"Aacute", # 201
|
|
215
|
+
"Edieresis", # 202
|
|
216
|
+
"Egrave", # 203
|
|
217
|
+
"Iacute", # 204
|
|
218
|
+
"Icircumflex", # 205
|
|
219
|
+
"Idieresis", # 206
|
|
220
|
+
"Igrave", # 207
|
|
221
|
+
"Oacute", # 208
|
|
222
|
+
"Ocircumflex", # 209
|
|
223
|
+
"apple", # 210
|
|
224
|
+
"Ograve", # 211
|
|
225
|
+
"Uacute", # 212
|
|
226
|
+
"Ucircumflex", # 213
|
|
227
|
+
"Ugrave", # 214
|
|
228
|
+
"dotlessi", # 215
|
|
229
|
+
"circumflex", # 216
|
|
230
|
+
"tilde", # 217
|
|
231
|
+
"macron", # 218
|
|
232
|
+
"breve", # 219
|
|
233
|
+
"dotaccent", # 220
|
|
234
|
+
"ring", # 221
|
|
235
|
+
"cedilla", # 222
|
|
236
|
+
"hungarumlaut", # 223
|
|
237
|
+
"ogonek", # 224
|
|
238
|
+
"caron", # 225
|
|
239
|
+
"Lslash", # 226
|
|
240
|
+
"lslash", # 227
|
|
241
|
+
"Scaron", # 228
|
|
242
|
+
"scaron", # 229
|
|
243
|
+
"Zcaron", # 230
|
|
244
|
+
"zcaron", # 231
|
|
245
|
+
"brokenbar", # 232
|
|
246
|
+
"Eth", # 233
|
|
247
|
+
"eth", # 234
|
|
248
|
+
"Yacute", # 235
|
|
249
|
+
"yacute", # 236
|
|
250
|
+
"Thorn", # 237
|
|
251
|
+
"thorn", # 238
|
|
252
|
+
"minus", # 239
|
|
253
|
+
"multiply", # 240
|
|
254
|
+
"onesuperior", # 241
|
|
255
|
+
"twosuperior", # 242
|
|
256
|
+
"threesuperior", # 243
|
|
257
|
+
"onehalf", # 244
|
|
258
|
+
"onequarter", # 245
|
|
259
|
+
"threequarters", # 246
|
|
260
|
+
"franc", # 247
|
|
261
|
+
"Gbreve", # 248
|
|
262
|
+
"gbreve", # 249
|
|
263
|
+
"Idotaccent", # 250
|
|
264
|
+
"Scedilla", # 251
|
|
265
|
+
"scedilla", # 252
|
|
266
|
+
"Cacute", # 253
|
|
267
|
+
"cacute", # 254
|
|
268
|
+
"Ccaron", # 255
|
|
269
|
+
"ccaron", # 256
|
|
270
|
+
"dcroat", # 257
|
|
271
|
+
]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from .otBase import BaseTTXConverter
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class table_B_A_S_E_(BaseTTXConverter):
|
|
5
|
+
"""Baseline table
|
|
6
|
+
|
|
7
|
+
The ``BASE`` table contains information needed to align glyphs in
|
|
8
|
+
different scripts, from different fonts, or at different sizes
|
|
9
|
+
within the same line of text.
|
|
10
|
+
|
|
11
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/base
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
pass
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Since bitmap glyph metrics are shared between EBLC and EBDT
|
|
2
|
+
# this class gets its own python file.
|
|
3
|
+
from fontTools.misc import sstruct
|
|
4
|
+
from fontTools.misc.textTools import safeEval
|
|
5
|
+
import logging
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
log = logging.getLogger(__name__)
|
|
9
|
+
|
|
10
|
+
bigGlyphMetricsFormat = """
|
|
11
|
+
> # big endian
|
|
12
|
+
height: B
|
|
13
|
+
width: B
|
|
14
|
+
horiBearingX: b
|
|
15
|
+
horiBearingY: b
|
|
16
|
+
horiAdvance: B
|
|
17
|
+
vertBearingX: b
|
|
18
|
+
vertBearingY: b
|
|
19
|
+
vertAdvance: B
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
smallGlyphMetricsFormat = """
|
|
23
|
+
> # big endian
|
|
24
|
+
height: B
|
|
25
|
+
width: B
|
|
26
|
+
BearingX: b
|
|
27
|
+
BearingY: b
|
|
28
|
+
Advance: B
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class BitmapGlyphMetrics(object):
|
|
33
|
+
def toXML(self, writer, ttFont):
|
|
34
|
+
writer.begintag(self.__class__.__name__)
|
|
35
|
+
writer.newline()
|
|
36
|
+
for metricName in sstruct.getformat(self.__class__.binaryFormat)[1]:
|
|
37
|
+
writer.simpletag(metricName, value=getattr(self, metricName))
|
|
38
|
+
writer.newline()
|
|
39
|
+
writer.endtag(self.__class__.__name__)
|
|
40
|
+
writer.newline()
|
|
41
|
+
|
|
42
|
+
def fromXML(self, name, attrs, content, ttFont):
|
|
43
|
+
metricNames = set(sstruct.getformat(self.__class__.binaryFormat)[1])
|
|
44
|
+
for element in content:
|
|
45
|
+
if not isinstance(element, tuple):
|
|
46
|
+
continue
|
|
47
|
+
name, attrs, content = element
|
|
48
|
+
# Make sure this is a metric that is needed by GlyphMetrics.
|
|
49
|
+
if name in metricNames:
|
|
50
|
+
vars(self)[name] = safeEval(attrs["value"])
|
|
51
|
+
else:
|
|
52
|
+
log.warning(
|
|
53
|
+
"unknown name '%s' being ignored in %s.",
|
|
54
|
+
name,
|
|
55
|
+
self.__class__.__name__,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class BigGlyphMetrics(BitmapGlyphMetrics):
|
|
60
|
+
binaryFormat = bigGlyphMetricsFormat
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class SmallGlyphMetrics(BitmapGlyphMetrics):
|
|
64
|
+
binaryFormat = smallGlyphMetricsFormat
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Copyright 2013 Google, Inc. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Google Author(s): Matt Fontaine
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from fontTools.misc.textTools import bytesjoin
|
|
7
|
+
from fontTools.misc import sstruct
|
|
8
|
+
from . import E_B_D_T_
|
|
9
|
+
from .BitmapGlyphMetrics import (
|
|
10
|
+
BigGlyphMetrics,
|
|
11
|
+
bigGlyphMetricsFormat,
|
|
12
|
+
SmallGlyphMetrics,
|
|
13
|
+
smallGlyphMetricsFormat,
|
|
14
|
+
)
|
|
15
|
+
from .E_B_D_T_ import (
|
|
16
|
+
BitmapGlyph,
|
|
17
|
+
BitmapPlusSmallMetricsMixin,
|
|
18
|
+
BitmapPlusBigMetricsMixin,
|
|
19
|
+
)
|
|
20
|
+
import struct
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class table_C_B_D_T_(E_B_D_T_.table_E_B_D_T_):
|
|
24
|
+
"""Color Bitmap Data table
|
|
25
|
+
|
|
26
|
+
The ``CBDT`` table contains color bitmap data for glyphs. It must
|
|
27
|
+
be used in concert with the ``CBLC`` table.
|
|
28
|
+
|
|
29
|
+
It is backwards-compatible with the monochrome/grayscale ``EBDT`` table.
|
|
30
|
+
|
|
31
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/cbdt
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
# Change the data locator table being referenced.
|
|
35
|
+
locatorName = "CBLC"
|
|
36
|
+
|
|
37
|
+
# Modify the format class accessor for color bitmap use.
|
|
38
|
+
def getImageFormatClass(self, imageFormat):
|
|
39
|
+
try:
|
|
40
|
+
return E_B_D_T_.table_E_B_D_T_.getImageFormatClass(self, imageFormat)
|
|
41
|
+
except KeyError:
|
|
42
|
+
return cbdt_bitmap_classes[imageFormat]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# Helper method for removing export features not supported by color bitmaps.
|
|
46
|
+
# Write data in the parent class will default to raw if an option is unsupported.
|
|
47
|
+
def _removeUnsupportedForColor(dataFunctions):
|
|
48
|
+
dataFunctions = dict(dataFunctions)
|
|
49
|
+
del dataFunctions["row"]
|
|
50
|
+
return dataFunctions
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class ColorBitmapGlyph(BitmapGlyph):
|
|
54
|
+
fileExtension = ".png"
|
|
55
|
+
xmlDataFunctions = _removeUnsupportedForColor(BitmapGlyph.xmlDataFunctions)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class cbdt_bitmap_format_17(BitmapPlusSmallMetricsMixin, ColorBitmapGlyph):
|
|
59
|
+
def decompile(self):
|
|
60
|
+
self.metrics = SmallGlyphMetrics()
|
|
61
|
+
dummy, data = sstruct.unpack2(smallGlyphMetricsFormat, self.data, self.metrics)
|
|
62
|
+
(dataLen,) = struct.unpack(">L", data[:4])
|
|
63
|
+
data = data[4:]
|
|
64
|
+
|
|
65
|
+
# For the image data cut it to the size specified by dataLen.
|
|
66
|
+
assert dataLen <= len(data), "Data overun in format 17"
|
|
67
|
+
self.imageData = data[:dataLen]
|
|
68
|
+
|
|
69
|
+
def compile(self, ttFont):
|
|
70
|
+
dataList = []
|
|
71
|
+
dataList.append(sstruct.pack(smallGlyphMetricsFormat, self.metrics))
|
|
72
|
+
dataList.append(struct.pack(">L", len(self.imageData)))
|
|
73
|
+
dataList.append(self.imageData)
|
|
74
|
+
return bytesjoin(dataList)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class cbdt_bitmap_format_18(BitmapPlusBigMetricsMixin, ColorBitmapGlyph):
|
|
78
|
+
def decompile(self):
|
|
79
|
+
self.metrics = BigGlyphMetrics()
|
|
80
|
+
dummy, data = sstruct.unpack2(bigGlyphMetricsFormat, self.data, self.metrics)
|
|
81
|
+
(dataLen,) = struct.unpack(">L", data[:4])
|
|
82
|
+
data = data[4:]
|
|
83
|
+
|
|
84
|
+
# For the image data cut it to the size specified by dataLen.
|
|
85
|
+
assert dataLen <= len(data), "Data overun in format 18"
|
|
86
|
+
self.imageData = data[:dataLen]
|
|
87
|
+
|
|
88
|
+
def compile(self, ttFont):
|
|
89
|
+
dataList = []
|
|
90
|
+
dataList.append(sstruct.pack(bigGlyphMetricsFormat, self.metrics))
|
|
91
|
+
dataList.append(struct.pack(">L", len(self.imageData)))
|
|
92
|
+
dataList.append(self.imageData)
|
|
93
|
+
return bytesjoin(dataList)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class cbdt_bitmap_format_19(ColorBitmapGlyph):
|
|
97
|
+
def decompile(self):
|
|
98
|
+
(dataLen,) = struct.unpack(">L", self.data[:4])
|
|
99
|
+
data = self.data[4:]
|
|
100
|
+
|
|
101
|
+
assert dataLen <= len(data), "Data overun in format 19"
|
|
102
|
+
self.imageData = data[:dataLen]
|
|
103
|
+
|
|
104
|
+
def compile(self, ttFont):
|
|
105
|
+
return struct.pack(">L", len(self.imageData)) + self.imageData
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# Dict for CBDT extended formats.
|
|
109
|
+
cbdt_bitmap_classes = {
|
|
110
|
+
17: cbdt_bitmap_format_17,
|
|
111
|
+
18: cbdt_bitmap_format_18,
|
|
112
|
+
19: cbdt_bitmap_format_19,
|
|
113
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Copyright 2013 Google, Inc. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Google Author(s): Matt Fontaine
|
|
4
|
+
|
|
5
|
+
from . import E_B_L_C_
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class table_C_B_L_C_(E_B_L_C_.table_E_B_L_C_):
|
|
9
|
+
"""Color Bitmap Location table
|
|
10
|
+
|
|
11
|
+
The ``CBLC`` table contains the locations of color bitmaps for glyphs. It must
|
|
12
|
+
be used in concert with the ``CBDT`` table.
|
|
13
|
+
|
|
14
|
+
It is backwards-compatible with the monochrome/grayscale ``EBLC`` table.
|
|
15
|
+
|
|
16
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/cblc
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
dependencies = ["CBDT"]
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from io import BytesIO
|
|
2
|
+
from fontTools import cffLib
|
|
3
|
+
from . import DefaultTable
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class table_C_F_F_(DefaultTable.DefaultTable):
|
|
7
|
+
"""Compact Font Format table (version 1)
|
|
8
|
+
|
|
9
|
+
The ``CFF`` table embeds a CFF-formatted font. The CFF font format
|
|
10
|
+
predates OpenType and could be used as a standalone font file, but the
|
|
11
|
+
``CFF`` table is also used to package CFF fonts into an OpenType
|
|
12
|
+
container.
|
|
13
|
+
|
|
14
|
+
.. note::
|
|
15
|
+
``CFF`` has been succeeded by ``CFF2``, which eliminates much of
|
|
16
|
+
the redundancy incurred by embedding CFF version 1 in an OpenType
|
|
17
|
+
font.
|
|
18
|
+
|
|
19
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/cff
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
def __init__(self, tag=None):
|
|
23
|
+
DefaultTable.DefaultTable.__init__(self, tag)
|
|
24
|
+
self.cff = cffLib.CFFFontSet()
|
|
25
|
+
self._gaveGlyphOrder = False
|
|
26
|
+
|
|
27
|
+
def decompile(self, data, otFont):
|
|
28
|
+
self.cff.decompile(BytesIO(data), otFont, isCFF2=False)
|
|
29
|
+
assert len(self.cff) == 1, "can't deal with multi-font CFF tables."
|
|
30
|
+
|
|
31
|
+
def compile(self, otFont):
|
|
32
|
+
f = BytesIO()
|
|
33
|
+
self.cff.compile(f, otFont, isCFF2=False)
|
|
34
|
+
return f.getvalue()
|
|
35
|
+
|
|
36
|
+
def haveGlyphNames(self):
|
|
37
|
+
if hasattr(self.cff[self.cff.fontNames[0]], "ROS"):
|
|
38
|
+
return False # CID-keyed font
|
|
39
|
+
else:
|
|
40
|
+
return True
|
|
41
|
+
|
|
42
|
+
def getGlyphOrder(self):
|
|
43
|
+
if self._gaveGlyphOrder:
|
|
44
|
+
from fontTools import ttLib
|
|
45
|
+
|
|
46
|
+
raise ttLib.TTLibError("illegal use of getGlyphOrder()")
|
|
47
|
+
self._gaveGlyphOrder = True
|
|
48
|
+
return self.cff[self.cff.fontNames[0]].getGlyphOrder()
|
|
49
|
+
|
|
50
|
+
def setGlyphOrder(self, glyphOrder):
|
|
51
|
+
pass
|
|
52
|
+
# XXX
|
|
53
|
+
# self.cff[self.cff.fontNames[0]].setGlyphOrder(glyphOrder)
|
|
54
|
+
|
|
55
|
+
def toXML(self, writer, otFont):
|
|
56
|
+
self.cff.toXML(writer)
|
|
57
|
+
|
|
58
|
+
def fromXML(self, name, attrs, content, otFont):
|
|
59
|
+
if not hasattr(self, "cff"):
|
|
60
|
+
self.cff = cffLib.CFFFontSet()
|
|
61
|
+
self.cff.fromXML(name, attrs, content, otFont)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from io import BytesIO
|
|
2
|
+
from fontTools.ttLib.tables.C_F_F_ import table_C_F_F_
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class table_C_F_F__2(table_C_F_F_):
|
|
6
|
+
"""Compact Font Format version 2 table
|
|
7
|
+
|
|
8
|
+
The ``CFF2`` table contains glyph data for a CFF2-flavored OpenType
|
|
9
|
+
font.
|
|
10
|
+
|
|
11
|
+
.. note::
|
|
12
|
+
``CFF2`` is the successor to ``CFF``, and eliminates much of
|
|
13
|
+
the redundancy incurred by embedding CFF version 1 in an OpenType
|
|
14
|
+
font.
|
|
15
|
+
|
|
16
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/cff2
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def decompile(self, data, otFont):
|
|
20
|
+
self.cff.decompile(BytesIO(data), otFont, isCFF2=True)
|
|
21
|
+
assert len(self.cff) == 1, "can't deal with multi-font CFF tables."
|
|
22
|
+
|
|
23
|
+
def compile(self, otFont):
|
|
24
|
+
f = BytesIO()
|
|
25
|
+
self.cff.compile(f, otFont, isCFF2=True)
|
|
26
|
+
return f.getvalue()
|