xref: /aosp_15_r20/external/fonttools/Tests/ufoLib/testSupport.py (revision e1fe3e4ad2793916b15cccdc4a7da52a7e1dd0e9)
1*e1fe3e4aSElliott Hughes"""Miscellaneous helpers for our test suite."""
2*e1fe3e4aSElliott Hughes
3*e1fe3e4aSElliott Hughesimport os
4*e1fe3e4aSElliott Hughesfrom fontTools.ufoLib.utils import numberTypes
5*e1fe3e4aSElliott Hughes
6*e1fe3e4aSElliott Hughes
7*e1fe3e4aSElliott Hughesdef getDemoFontPath():
8*e1fe3e4aSElliott Hughes    """Return the path to Data/DemoFont.ufo/."""
9*e1fe3e4aSElliott Hughes    testdata = os.path.join(os.path.dirname(__file__), "testdata")
10*e1fe3e4aSElliott Hughes    return os.path.join(testdata, "DemoFont.ufo")
11*e1fe3e4aSElliott Hughes
12*e1fe3e4aSElliott Hughes
13*e1fe3e4aSElliott Hughesdef getDemoFontGlyphSetPath():
14*e1fe3e4aSElliott Hughes    """Return the path to Data/DemoFont.ufo/glyphs/."""
15*e1fe3e4aSElliott Hughes    return os.path.join(getDemoFontPath(), "glyphs")
16*e1fe3e4aSElliott Hughes
17*e1fe3e4aSElliott Hughes
18*e1fe3e4aSElliott Hughes# GLIF test tools
19*e1fe3e4aSElliott Hughes
20*e1fe3e4aSElliott Hughes
21*e1fe3e4aSElliott Hughesclass Glyph:
22*e1fe3e4aSElliott Hughes    def __init__(self):
23*e1fe3e4aSElliott Hughes        self.name = None
24*e1fe3e4aSElliott Hughes        self.width = None
25*e1fe3e4aSElliott Hughes        self.height = None
26*e1fe3e4aSElliott Hughes        self.unicodes = None
27*e1fe3e4aSElliott Hughes        self.note = None
28*e1fe3e4aSElliott Hughes        self.lib = None
29*e1fe3e4aSElliott Hughes        self.image = None
30*e1fe3e4aSElliott Hughes        self.guidelines = None
31*e1fe3e4aSElliott Hughes        self.anchors = None
32*e1fe3e4aSElliott Hughes        self.outline = []
33*e1fe3e4aSElliott Hughes
34*e1fe3e4aSElliott Hughes    def _writePointPenCommand(self, command, args, kwargs):
35*e1fe3e4aSElliott Hughes        args = _listToString(args)
36*e1fe3e4aSElliott Hughes        kwargs = _dictToString(kwargs)
37*e1fe3e4aSElliott Hughes        if args and kwargs:
38*e1fe3e4aSElliott Hughes            return f"pointPen.{command}(*{args}, **{kwargs})"
39*e1fe3e4aSElliott Hughes        elif len(args):
40*e1fe3e4aSElliott Hughes            return f"pointPen.{command}(*{args})"
41*e1fe3e4aSElliott Hughes        elif len(kwargs):
42*e1fe3e4aSElliott Hughes            return f"pointPen.{command}(**{kwargs})"
43*e1fe3e4aSElliott Hughes        else:
44*e1fe3e4aSElliott Hughes            return "pointPen.%s()" % command
45*e1fe3e4aSElliott Hughes
46*e1fe3e4aSElliott Hughes    def beginPath(self, **kwargs):
47*e1fe3e4aSElliott Hughes        self.outline.append(self._writePointPenCommand("beginPath", [], kwargs))
48*e1fe3e4aSElliott Hughes
49*e1fe3e4aSElliott Hughes    def endPath(self):
50*e1fe3e4aSElliott Hughes        self.outline.append(self._writePointPenCommand("endPath", [], {}))
51*e1fe3e4aSElliott Hughes
52*e1fe3e4aSElliott Hughes    def addPoint(self, *args, **kwargs):
53*e1fe3e4aSElliott Hughes        self.outline.append(self._writePointPenCommand("addPoint", args, kwargs))
54*e1fe3e4aSElliott Hughes
55*e1fe3e4aSElliott Hughes    def addComponent(self, *args, **kwargs):
56*e1fe3e4aSElliott Hughes        self.outline.append(self._writePointPenCommand("addComponent", args, kwargs))
57*e1fe3e4aSElliott Hughes
58*e1fe3e4aSElliott Hughes    def drawPoints(self, pointPen):
59*e1fe3e4aSElliott Hughes        if self.outline:
60*e1fe3e4aSElliott Hughes            py = "\n".join(self.outline)
61*e1fe3e4aSElliott Hughes            exec(py, {"pointPen": pointPen})
62*e1fe3e4aSElliott Hughes
63*e1fe3e4aSElliott Hughes    def py(self):
64*e1fe3e4aSElliott Hughes        text = []
65*e1fe3e4aSElliott Hughes        if self.name is not None:
66*e1fe3e4aSElliott Hughes            text.append('glyph.name = "%s"' % self.name)
67*e1fe3e4aSElliott Hughes        if self.width:
68*e1fe3e4aSElliott Hughes            text.append("glyph.width = %r" % self.width)
69*e1fe3e4aSElliott Hughes        if self.height:
70*e1fe3e4aSElliott Hughes            text.append("glyph.height = %r" % self.height)
71*e1fe3e4aSElliott Hughes        if self.unicodes is not None:
72*e1fe3e4aSElliott Hughes            text.append(
73*e1fe3e4aSElliott Hughes                "glyph.unicodes = [%s]" % ", ".join([str(i) for i in self.unicodes])
74*e1fe3e4aSElliott Hughes            )
75*e1fe3e4aSElliott Hughes        if self.note is not None:
76*e1fe3e4aSElliott Hughes            text.append('glyph.note = "%s"' % self.note)
77*e1fe3e4aSElliott Hughes        if self.lib is not None:
78*e1fe3e4aSElliott Hughes            text.append("glyph.lib = %s" % _dictToString(self.lib))
79*e1fe3e4aSElliott Hughes        if self.image is not None:
80*e1fe3e4aSElliott Hughes            text.append("glyph.image = %s" % _dictToString(self.image))
81*e1fe3e4aSElliott Hughes        if self.guidelines is not None:
82*e1fe3e4aSElliott Hughes            text.append("glyph.guidelines = %s" % _listToString(self.guidelines))
83*e1fe3e4aSElliott Hughes        if self.anchors is not None:
84*e1fe3e4aSElliott Hughes            text.append("glyph.anchors = %s" % _listToString(self.anchors))
85*e1fe3e4aSElliott Hughes        if self.outline:
86*e1fe3e4aSElliott Hughes            text += self.outline
87*e1fe3e4aSElliott Hughes        return "\n".join(text)
88*e1fe3e4aSElliott Hughes
89*e1fe3e4aSElliott Hughes
90*e1fe3e4aSElliott Hughesdef _dictToString(d):
91*e1fe3e4aSElliott Hughes    text = []
92*e1fe3e4aSElliott Hughes    for key, value in sorted(d.items()):
93*e1fe3e4aSElliott Hughes        if value is None:
94*e1fe3e4aSElliott Hughes            continue
95*e1fe3e4aSElliott Hughes        key = '"%s"' % key
96*e1fe3e4aSElliott Hughes        if isinstance(value, dict):
97*e1fe3e4aSElliott Hughes            value = _dictToString(value)
98*e1fe3e4aSElliott Hughes        elif isinstance(value, list):
99*e1fe3e4aSElliott Hughes            value = _listToString(value)
100*e1fe3e4aSElliott Hughes        elif isinstance(value, tuple):
101*e1fe3e4aSElliott Hughes            value = _tupleToString(value)
102*e1fe3e4aSElliott Hughes        elif isinstance(value, numberTypes):
103*e1fe3e4aSElliott Hughes            value = repr(value)
104*e1fe3e4aSElliott Hughes        elif isinstance(value, str):
105*e1fe3e4aSElliott Hughes            value = '"%s"' % value
106*e1fe3e4aSElliott Hughes        text.append(f"{key} : {value}")
107*e1fe3e4aSElliott Hughes    if not text:
108*e1fe3e4aSElliott Hughes        return ""
109*e1fe3e4aSElliott Hughes    return "{%s}" % ", ".join(text)
110*e1fe3e4aSElliott Hughes
111*e1fe3e4aSElliott Hughes
112*e1fe3e4aSElliott Hughesdef _listToString(l):
113*e1fe3e4aSElliott Hughes    text = []
114*e1fe3e4aSElliott Hughes    for value in l:
115*e1fe3e4aSElliott Hughes        if isinstance(value, dict):
116*e1fe3e4aSElliott Hughes            value = _dictToString(value)
117*e1fe3e4aSElliott Hughes        elif isinstance(value, list):
118*e1fe3e4aSElliott Hughes            value = _listToString(value)
119*e1fe3e4aSElliott Hughes        elif isinstance(value, tuple):
120*e1fe3e4aSElliott Hughes            value = _tupleToString(value)
121*e1fe3e4aSElliott Hughes        elif isinstance(value, numberTypes):
122*e1fe3e4aSElliott Hughes            value = repr(value)
123*e1fe3e4aSElliott Hughes        elif isinstance(value, str):
124*e1fe3e4aSElliott Hughes            value = '"%s"' % value
125*e1fe3e4aSElliott Hughes        text.append(value)
126*e1fe3e4aSElliott Hughes    if not text:
127*e1fe3e4aSElliott Hughes        return ""
128*e1fe3e4aSElliott Hughes    return "[%s]" % ", ".join(text)
129*e1fe3e4aSElliott Hughes
130*e1fe3e4aSElliott Hughes
131*e1fe3e4aSElliott Hughesdef _tupleToString(t):
132*e1fe3e4aSElliott Hughes    text = []
133*e1fe3e4aSElliott Hughes    for value in t:
134*e1fe3e4aSElliott Hughes        if isinstance(value, dict):
135*e1fe3e4aSElliott Hughes            value = _dictToString(value)
136*e1fe3e4aSElliott Hughes        elif isinstance(value, list):
137*e1fe3e4aSElliott Hughes            value = _listToString(value)
138*e1fe3e4aSElliott Hughes        elif isinstance(value, tuple):
139*e1fe3e4aSElliott Hughes            value = _tupleToString(value)
140*e1fe3e4aSElliott Hughes        elif isinstance(value, numberTypes):
141*e1fe3e4aSElliott Hughes            value = repr(value)
142*e1fe3e4aSElliott Hughes        elif isinstance(value, str):
143*e1fe3e4aSElliott Hughes            value = '"%s"' % value
144*e1fe3e4aSElliott Hughes        text.append(value)
145*e1fe3e4aSElliott Hughes    if not text:
146*e1fe3e4aSElliott Hughes        return ""
147*e1fe3e4aSElliott Hughes    return "(%s)" % ", ".join(text)
148*e1fe3e4aSElliott Hughes
149*e1fe3e4aSElliott Hughes
150*e1fe3e4aSElliott Hughesdef stripText(text):
151*e1fe3e4aSElliott Hughes    new = []
152*e1fe3e4aSElliott Hughes    for line in text.strip().splitlines():
153*e1fe3e4aSElliott Hughes        line = line.strip()
154*e1fe3e4aSElliott Hughes        if not line:
155*e1fe3e4aSElliott Hughes            continue
156*e1fe3e4aSElliott Hughes        new.append(line)
157*e1fe3e4aSElliott Hughes    return "\n".join(new)
158*e1fe3e4aSElliott Hughes
159*e1fe3e4aSElliott Hughes
160*e1fe3e4aSElliott Hughes# font info values used by several tests
161*e1fe3e4aSElliott Hughes
162*e1fe3e4aSElliott HughesfontInfoVersion1 = {
163*e1fe3e4aSElliott Hughes    "familyName": "Some Font (Family Name)",
164*e1fe3e4aSElliott Hughes    "styleName": "Regular (Style Name)",
165*e1fe3e4aSElliott Hughes    "fullName": "Some Font-Regular (Postscript Full Name)",
166*e1fe3e4aSElliott Hughes    "fontName": "SomeFont-Regular (Postscript Font Name)",
167*e1fe3e4aSElliott Hughes    "menuName": "Some Font Regular (Style Map Family Name)",
168*e1fe3e4aSElliott Hughes    "fontStyle": 64,
169*e1fe3e4aSElliott Hughes    "note": "A note.",
170*e1fe3e4aSElliott Hughes    "versionMajor": 1,
171*e1fe3e4aSElliott Hughes    "versionMinor": 0,
172*e1fe3e4aSElliott Hughes    "year": 2008,
173*e1fe3e4aSElliott Hughes    "copyright": "Copyright Some Foundry.",
174*e1fe3e4aSElliott Hughes    "notice": "Some Font by Some Designer for Some Foundry.",
175*e1fe3e4aSElliott Hughes    "trademark": "Trademark Some Foundry",
176*e1fe3e4aSElliott Hughes    "license": "License info for Some Foundry.",
177*e1fe3e4aSElliott Hughes    "licenseURL": "http://somefoundry.com/license",
178*e1fe3e4aSElliott Hughes    "createdBy": "Some Foundry",
179*e1fe3e4aSElliott Hughes    "designer": "Some Designer",
180*e1fe3e4aSElliott Hughes    "designerURL": "http://somedesigner.com",
181*e1fe3e4aSElliott Hughes    "vendorURL": "http://somefoundry.com",
182*e1fe3e4aSElliott Hughes    "unitsPerEm": 1000,
183*e1fe3e4aSElliott Hughes    "ascender": 750,
184*e1fe3e4aSElliott Hughes    "descender": -250,
185*e1fe3e4aSElliott Hughes    "capHeight": 750,
186*e1fe3e4aSElliott Hughes    "xHeight": 500,
187*e1fe3e4aSElliott Hughes    "defaultWidth": 400,
188*e1fe3e4aSElliott Hughes    "slantAngle": -12.5,
189*e1fe3e4aSElliott Hughes    "italicAngle": -12.5,
190*e1fe3e4aSElliott Hughes    "widthName": "Medium (normal)",
191*e1fe3e4aSElliott Hughes    "weightName": "Medium",
192*e1fe3e4aSElliott Hughes    "weightValue": 500,
193*e1fe3e4aSElliott Hughes    "fondName": "SomeFont Regular (FOND Name)",
194*e1fe3e4aSElliott Hughes    "otFamilyName": "Some Font (Preferred Family Name)",
195*e1fe3e4aSElliott Hughes    "otStyleName": "Regular (Preferred Subfamily Name)",
196*e1fe3e4aSElliott Hughes    "otMacName": "Some Font Regular (Compatible Full Name)",
197*e1fe3e4aSElliott Hughes    "msCharSet": 0,
198*e1fe3e4aSElliott Hughes    "fondID": 15000,
199*e1fe3e4aSElliott Hughes    "uniqueID": 4000000,
200*e1fe3e4aSElliott Hughes    "ttVendor": "SOME",
201*e1fe3e4aSElliott Hughes    "ttUniqueID": "OpenType name Table Unique ID",
202*e1fe3e4aSElliott Hughes    "ttVersion": "OpenType name Table Version",
203*e1fe3e4aSElliott Hughes}
204*e1fe3e4aSElliott Hughes
205*e1fe3e4aSElliott HughesfontInfoVersion2 = {
206*e1fe3e4aSElliott Hughes    "familyName": "Some Font (Family Name)",
207*e1fe3e4aSElliott Hughes    "styleName": "Regular (Style Name)",
208*e1fe3e4aSElliott Hughes    "styleMapFamilyName": "Some Font Regular (Style Map Family Name)",
209*e1fe3e4aSElliott Hughes    "styleMapStyleName": "regular",
210*e1fe3e4aSElliott Hughes    "versionMajor": 1,
211*e1fe3e4aSElliott Hughes    "versionMinor": 0,
212*e1fe3e4aSElliott Hughes    "year": 2008,
213*e1fe3e4aSElliott Hughes    "copyright": "Copyright Some Foundry.",
214*e1fe3e4aSElliott Hughes    "trademark": "Trademark Some Foundry",
215*e1fe3e4aSElliott Hughes    "unitsPerEm": 1000,
216*e1fe3e4aSElliott Hughes    "descender": -250,
217*e1fe3e4aSElliott Hughes    "xHeight": 500,
218*e1fe3e4aSElliott Hughes    "capHeight": 750,
219*e1fe3e4aSElliott Hughes    "ascender": 750,
220*e1fe3e4aSElliott Hughes    "italicAngle": -12.5,
221*e1fe3e4aSElliott Hughes    "note": "A note.",
222*e1fe3e4aSElliott Hughes    "openTypeHeadCreated": "2000/01/01 00:00:00",
223*e1fe3e4aSElliott Hughes    "openTypeHeadLowestRecPPEM": 10,
224*e1fe3e4aSElliott Hughes    "openTypeHeadFlags": [0, 1],
225*e1fe3e4aSElliott Hughes    "openTypeHheaAscender": 750,
226*e1fe3e4aSElliott Hughes    "openTypeHheaDescender": -250,
227*e1fe3e4aSElliott Hughes    "openTypeHheaLineGap": 200,
228*e1fe3e4aSElliott Hughes    "openTypeHheaCaretSlopeRise": 1,
229*e1fe3e4aSElliott Hughes    "openTypeHheaCaretSlopeRun": 0,
230*e1fe3e4aSElliott Hughes    "openTypeHheaCaretOffset": 0,
231*e1fe3e4aSElliott Hughes    "openTypeNameDesigner": "Some Designer",
232*e1fe3e4aSElliott Hughes    "openTypeNameDesignerURL": "http://somedesigner.com",
233*e1fe3e4aSElliott Hughes    "openTypeNameManufacturer": "Some Foundry",
234*e1fe3e4aSElliott Hughes    "openTypeNameManufacturerURL": "http://somefoundry.com",
235*e1fe3e4aSElliott Hughes    "openTypeNameLicense": "License info for Some Foundry.",
236*e1fe3e4aSElliott Hughes    "openTypeNameLicenseURL": "http://somefoundry.com/license",
237*e1fe3e4aSElliott Hughes    "openTypeNameVersion": "OpenType name Table Version",
238*e1fe3e4aSElliott Hughes    "openTypeNameUniqueID": "OpenType name Table Unique ID",
239*e1fe3e4aSElliott Hughes    "openTypeNameDescription": "Some Font by Some Designer for Some Foundry.",
240*e1fe3e4aSElliott Hughes    "openTypeNamePreferredFamilyName": "Some Font (Preferred Family Name)",
241*e1fe3e4aSElliott Hughes    "openTypeNamePreferredSubfamilyName": "Regular (Preferred Subfamily Name)",
242*e1fe3e4aSElliott Hughes    "openTypeNameCompatibleFullName": "Some Font Regular (Compatible Full Name)",
243*e1fe3e4aSElliott Hughes    "openTypeNameSampleText": "Sample Text for Some Font.",
244*e1fe3e4aSElliott Hughes    "openTypeNameWWSFamilyName": "Some Font (WWS Family Name)",
245*e1fe3e4aSElliott Hughes    "openTypeNameWWSSubfamilyName": "Regular (WWS Subfamily Name)",
246*e1fe3e4aSElliott Hughes    "openTypeOS2WidthClass": 5,
247*e1fe3e4aSElliott Hughes    "openTypeOS2WeightClass": 500,
248*e1fe3e4aSElliott Hughes    "openTypeOS2Selection": [3],
249*e1fe3e4aSElliott Hughes    "openTypeOS2VendorID": "SOME",
250*e1fe3e4aSElliott Hughes    "openTypeOS2Panose": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
251*e1fe3e4aSElliott Hughes    "openTypeOS2FamilyClass": [1, 1],
252*e1fe3e4aSElliott Hughes    "openTypeOS2UnicodeRanges": [0, 1],
253*e1fe3e4aSElliott Hughes    "openTypeOS2CodePageRanges": [0, 1],
254*e1fe3e4aSElliott Hughes    "openTypeOS2TypoAscender": 750,
255*e1fe3e4aSElliott Hughes    "openTypeOS2TypoDescender": -250,
256*e1fe3e4aSElliott Hughes    "openTypeOS2TypoLineGap": 200,
257*e1fe3e4aSElliott Hughes    "openTypeOS2WinAscent": 750,
258*e1fe3e4aSElliott Hughes    "openTypeOS2WinDescent": 250,
259*e1fe3e4aSElliott Hughes    "openTypeOS2Type": [],
260*e1fe3e4aSElliott Hughes    "openTypeOS2SubscriptXSize": 200,
261*e1fe3e4aSElliott Hughes    "openTypeOS2SubscriptYSize": 400,
262*e1fe3e4aSElliott Hughes    "openTypeOS2SubscriptXOffset": 0,
263*e1fe3e4aSElliott Hughes    "openTypeOS2SubscriptYOffset": -100,
264*e1fe3e4aSElliott Hughes    "openTypeOS2SuperscriptXSize": 200,
265*e1fe3e4aSElliott Hughes    "openTypeOS2SuperscriptYSize": 400,
266*e1fe3e4aSElliott Hughes    "openTypeOS2SuperscriptXOffset": 0,
267*e1fe3e4aSElliott Hughes    "openTypeOS2SuperscriptYOffset": 200,
268*e1fe3e4aSElliott Hughes    "openTypeOS2StrikeoutSize": 20,
269*e1fe3e4aSElliott Hughes    "openTypeOS2StrikeoutPosition": 300,
270*e1fe3e4aSElliott Hughes    "openTypeVheaVertTypoAscender": 750,
271*e1fe3e4aSElliott Hughes    "openTypeVheaVertTypoDescender": -250,
272*e1fe3e4aSElliott Hughes    "openTypeVheaVertTypoLineGap": 200,
273*e1fe3e4aSElliott Hughes    "openTypeVheaCaretSlopeRise": 0,
274*e1fe3e4aSElliott Hughes    "openTypeVheaCaretSlopeRun": 1,
275*e1fe3e4aSElliott Hughes    "openTypeVheaCaretOffset": 0,
276*e1fe3e4aSElliott Hughes    "postscriptFontName": "SomeFont-Regular (Postscript Font Name)",
277*e1fe3e4aSElliott Hughes    "postscriptFullName": "Some Font-Regular (Postscript Full Name)",
278*e1fe3e4aSElliott Hughes    "postscriptSlantAngle": -12.5,
279*e1fe3e4aSElliott Hughes    "postscriptUniqueID": 4000000,
280*e1fe3e4aSElliott Hughes    "postscriptUnderlineThickness": 20,
281*e1fe3e4aSElliott Hughes    "postscriptUnderlinePosition": -200,
282*e1fe3e4aSElliott Hughes    "postscriptIsFixedPitch": False,
283*e1fe3e4aSElliott Hughes    "postscriptBlueValues": [500, 510],
284*e1fe3e4aSElliott Hughes    "postscriptOtherBlues": [-250, -260],
285*e1fe3e4aSElliott Hughes    "postscriptFamilyBlues": [500, 510],
286*e1fe3e4aSElliott Hughes    "postscriptFamilyOtherBlues": [-250, -260],
287*e1fe3e4aSElliott Hughes    "postscriptStemSnapH": [100, 120],
288*e1fe3e4aSElliott Hughes    "postscriptStemSnapV": [80, 90],
289*e1fe3e4aSElliott Hughes    "postscriptBlueFuzz": 1,
290*e1fe3e4aSElliott Hughes    "postscriptBlueShift": 7,
291*e1fe3e4aSElliott Hughes    "postscriptBlueScale": 0.039625,
292*e1fe3e4aSElliott Hughes    "postscriptForceBold": True,
293*e1fe3e4aSElliott Hughes    "postscriptDefaultWidthX": 400,
294*e1fe3e4aSElliott Hughes    "postscriptNominalWidthX": 400,
295*e1fe3e4aSElliott Hughes    "postscriptWeightName": "Medium",
296*e1fe3e4aSElliott Hughes    "postscriptDefaultCharacter": ".notdef",
297*e1fe3e4aSElliott Hughes    "postscriptWindowsCharacterSet": 1,
298*e1fe3e4aSElliott Hughes    "macintoshFONDFamilyID": 15000,
299*e1fe3e4aSElliott Hughes    "macintoshFONDName": "SomeFont Regular (FOND Name)",
300*e1fe3e4aSElliott Hughes}
301*e1fe3e4aSElliott Hughes
302*e1fe3e4aSElliott HughesfontInfoVersion3 = {
303*e1fe3e4aSElliott Hughes    "familyName": "Some Font (Family Name)",
304*e1fe3e4aSElliott Hughes    "styleName": "Regular (Style Name)",
305*e1fe3e4aSElliott Hughes    "styleMapFamilyName": "Some Font Regular (Style Map Family Name)",
306*e1fe3e4aSElliott Hughes    "styleMapStyleName": "regular",
307*e1fe3e4aSElliott Hughes    "versionMajor": 1,
308*e1fe3e4aSElliott Hughes    "versionMinor": 0,
309*e1fe3e4aSElliott Hughes    "year": 2008,
310*e1fe3e4aSElliott Hughes    "copyright": "Copyright Some Foundry.",
311*e1fe3e4aSElliott Hughes    "trademark": "Trademark Some Foundry",
312*e1fe3e4aSElliott Hughes    "unitsPerEm": 1000,
313*e1fe3e4aSElliott Hughes    "descender": -250,
314*e1fe3e4aSElliott Hughes    "xHeight": 500,
315*e1fe3e4aSElliott Hughes    "capHeight": 750,
316*e1fe3e4aSElliott Hughes    "ascender": 750,
317*e1fe3e4aSElliott Hughes    "italicAngle": -12.5,
318*e1fe3e4aSElliott Hughes    "note": "A note.",
319*e1fe3e4aSElliott Hughes    "openTypeGaspRangeRecords": [
320*e1fe3e4aSElliott Hughes        dict(rangeMaxPPEM=10, rangeGaspBehavior=[0]),
321*e1fe3e4aSElliott Hughes        dict(rangeMaxPPEM=20, rangeGaspBehavior=[1]),
322*e1fe3e4aSElliott Hughes        dict(rangeMaxPPEM=30, rangeGaspBehavior=[2]),
323*e1fe3e4aSElliott Hughes        dict(rangeMaxPPEM=40, rangeGaspBehavior=[3]),
324*e1fe3e4aSElliott Hughes        dict(rangeMaxPPEM=50, rangeGaspBehavior=[0, 1, 2, 3]),
325*e1fe3e4aSElliott Hughes        dict(rangeMaxPPEM=0xFFFF, rangeGaspBehavior=[0]),
326*e1fe3e4aSElliott Hughes    ],
327*e1fe3e4aSElliott Hughes    "openTypeHeadCreated": "2000/01/01 00:00:00",
328*e1fe3e4aSElliott Hughes    "openTypeHeadLowestRecPPEM": 10,
329*e1fe3e4aSElliott Hughes    "openTypeHeadFlags": [0, 1],
330*e1fe3e4aSElliott Hughes    "openTypeHheaAscender": 750,
331*e1fe3e4aSElliott Hughes    "openTypeHheaDescender": -250,
332*e1fe3e4aSElliott Hughes    "openTypeHheaLineGap": 200,
333*e1fe3e4aSElliott Hughes    "openTypeHheaCaretSlopeRise": 1,
334*e1fe3e4aSElliott Hughes    "openTypeHheaCaretSlopeRun": 0,
335*e1fe3e4aSElliott Hughes    "openTypeHheaCaretOffset": 0,
336*e1fe3e4aSElliott Hughes    "openTypeNameDesigner": "Some Designer",
337*e1fe3e4aSElliott Hughes    "openTypeNameDesignerURL": "http://somedesigner.com",
338*e1fe3e4aSElliott Hughes    "openTypeNameManufacturer": "Some Foundry",
339*e1fe3e4aSElliott Hughes    "openTypeNameManufacturerURL": "http://somefoundry.com",
340*e1fe3e4aSElliott Hughes    "openTypeNameLicense": "License info for Some Foundry.",
341*e1fe3e4aSElliott Hughes    "openTypeNameLicenseURL": "http://somefoundry.com/license",
342*e1fe3e4aSElliott Hughes    "openTypeNameVersion": "OpenType name Table Version",
343*e1fe3e4aSElliott Hughes    "openTypeNameUniqueID": "OpenType name Table Unique ID",
344*e1fe3e4aSElliott Hughes    "openTypeNameDescription": "Some Font by Some Designer for Some Foundry.",
345*e1fe3e4aSElliott Hughes    "openTypeNamePreferredFamilyName": "Some Font (Preferred Family Name)",
346*e1fe3e4aSElliott Hughes    "openTypeNamePreferredSubfamilyName": "Regular (Preferred Subfamily Name)",
347*e1fe3e4aSElliott Hughes    "openTypeNameCompatibleFullName": "Some Font Regular (Compatible Full Name)",
348*e1fe3e4aSElliott Hughes    "openTypeNameSampleText": "Sample Text for Some Font.",
349*e1fe3e4aSElliott Hughes    "openTypeNameWWSFamilyName": "Some Font (WWS Family Name)",
350*e1fe3e4aSElliott Hughes    "openTypeNameWWSSubfamilyName": "Regular (WWS Subfamily Name)",
351*e1fe3e4aSElliott Hughes    "openTypeNameRecords": [
352*e1fe3e4aSElliott Hughes        dict(nameID=1, platformID=1, encodingID=1, languageID=1, string="Name Record."),
353*e1fe3e4aSElliott Hughes        dict(nameID=2, platformID=1, encodingID=1, languageID=1, string="Name Record."),
354*e1fe3e4aSElliott Hughes    ],
355*e1fe3e4aSElliott Hughes    "openTypeOS2WidthClass": 5,
356*e1fe3e4aSElliott Hughes    "openTypeOS2WeightClass": 500,
357*e1fe3e4aSElliott Hughes    "openTypeOS2Selection": [3],
358*e1fe3e4aSElliott Hughes    "openTypeOS2VendorID": "SOME",
359*e1fe3e4aSElliott Hughes    "openTypeOS2Panose": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
360*e1fe3e4aSElliott Hughes    "openTypeOS2FamilyClass": [1, 1],
361*e1fe3e4aSElliott Hughes    "openTypeOS2UnicodeRanges": [0, 1],
362*e1fe3e4aSElliott Hughes    "openTypeOS2CodePageRanges": [0, 1],
363*e1fe3e4aSElliott Hughes    "openTypeOS2TypoAscender": 750,
364*e1fe3e4aSElliott Hughes    "openTypeOS2TypoDescender": -250,
365*e1fe3e4aSElliott Hughes    "openTypeOS2TypoLineGap": 200,
366*e1fe3e4aSElliott Hughes    "openTypeOS2WinAscent": 750,
367*e1fe3e4aSElliott Hughes    "openTypeOS2WinDescent": 250,
368*e1fe3e4aSElliott Hughes    "openTypeOS2Type": [],
369*e1fe3e4aSElliott Hughes    "openTypeOS2SubscriptXSize": 200,
370*e1fe3e4aSElliott Hughes    "openTypeOS2SubscriptYSize": 400,
371*e1fe3e4aSElliott Hughes    "openTypeOS2SubscriptXOffset": 0,
372*e1fe3e4aSElliott Hughes    "openTypeOS2SubscriptYOffset": -100,
373*e1fe3e4aSElliott Hughes    "openTypeOS2SuperscriptXSize": 200,
374*e1fe3e4aSElliott Hughes    "openTypeOS2SuperscriptYSize": 400,
375*e1fe3e4aSElliott Hughes    "openTypeOS2SuperscriptXOffset": 0,
376*e1fe3e4aSElliott Hughes    "openTypeOS2SuperscriptYOffset": 200,
377*e1fe3e4aSElliott Hughes    "openTypeOS2StrikeoutSize": 20,
378*e1fe3e4aSElliott Hughes    "openTypeOS2StrikeoutPosition": 300,
379*e1fe3e4aSElliott Hughes    "openTypeVheaVertTypoAscender": 750,
380*e1fe3e4aSElliott Hughes    "openTypeVheaVertTypoDescender": -250,
381*e1fe3e4aSElliott Hughes    "openTypeVheaVertTypoLineGap": 200,
382*e1fe3e4aSElliott Hughes    "openTypeVheaCaretSlopeRise": 0,
383*e1fe3e4aSElliott Hughes    "openTypeVheaCaretSlopeRun": 1,
384*e1fe3e4aSElliott Hughes    "openTypeVheaCaretOffset": 0,
385*e1fe3e4aSElliott Hughes    "postscriptFontName": "SomeFont-Regular (Postscript Font Name)",
386*e1fe3e4aSElliott Hughes    "postscriptFullName": "Some Font-Regular (Postscript Full Name)",
387*e1fe3e4aSElliott Hughes    "postscriptSlantAngle": -12.5,
388*e1fe3e4aSElliott Hughes    "postscriptUniqueID": 4000000,
389*e1fe3e4aSElliott Hughes    "postscriptUnderlineThickness": 20,
390*e1fe3e4aSElliott Hughes    "postscriptUnderlinePosition": -200,
391*e1fe3e4aSElliott Hughes    "postscriptIsFixedPitch": False,
392*e1fe3e4aSElliott Hughes    "postscriptBlueValues": [500, 510],
393*e1fe3e4aSElliott Hughes    "postscriptOtherBlues": [-250, -260],
394*e1fe3e4aSElliott Hughes    "postscriptFamilyBlues": [500, 510],
395*e1fe3e4aSElliott Hughes    "postscriptFamilyOtherBlues": [-250, -260],
396*e1fe3e4aSElliott Hughes    "postscriptStemSnapH": [100, 120],
397*e1fe3e4aSElliott Hughes    "postscriptStemSnapV": [80, 90],
398*e1fe3e4aSElliott Hughes    "postscriptBlueFuzz": 1,
399*e1fe3e4aSElliott Hughes    "postscriptBlueShift": 7,
400*e1fe3e4aSElliott Hughes    "postscriptBlueScale": 0.039625,
401*e1fe3e4aSElliott Hughes    "postscriptForceBold": True,
402*e1fe3e4aSElliott Hughes    "postscriptDefaultWidthX": 400,
403*e1fe3e4aSElliott Hughes    "postscriptNominalWidthX": 400,
404*e1fe3e4aSElliott Hughes    "postscriptWeightName": "Medium",
405*e1fe3e4aSElliott Hughes    "postscriptDefaultCharacter": ".notdef",
406*e1fe3e4aSElliott Hughes    "postscriptWindowsCharacterSet": 1,
407*e1fe3e4aSElliott Hughes    "macintoshFONDFamilyID": 15000,
408*e1fe3e4aSElliott Hughes    "macintoshFONDName": "SomeFont Regular (FOND Name)",
409*e1fe3e4aSElliott Hughes    "woffMajorVersion": 1,
410*e1fe3e4aSElliott Hughes    "woffMinorVersion": 0,
411*e1fe3e4aSElliott Hughes    "woffMetadataUniqueID": dict(id="string"),
412*e1fe3e4aSElliott Hughes    "woffMetadataVendor": dict(name="Some Foundry", url="http://somefoundry.com"),
413*e1fe3e4aSElliott Hughes    "woffMetadataCredits": dict(
414*e1fe3e4aSElliott Hughes        credits=[
415*e1fe3e4aSElliott Hughes            dict(name="Some Designer"),
416*e1fe3e4aSElliott Hughes            dict(name=""),
417*e1fe3e4aSElliott Hughes            dict(name="Some Designer", url="http://somedesigner.com"),
418*e1fe3e4aSElliott Hughes            dict(name="Some Designer", url=""),
419*e1fe3e4aSElliott Hughes            dict(name="Some Designer", role="Designer"),
420*e1fe3e4aSElliott Hughes            dict(name="Some Designer", role=""),
421*e1fe3e4aSElliott Hughes            dict(name="Some Designer", dir="ltr"),
422*e1fe3e4aSElliott Hughes            dict(name="rengiseD emoS", dir="rtl"),
423*e1fe3e4aSElliott Hughes            {"name": "Some Designer", "class": "hello"},
424*e1fe3e4aSElliott Hughes            {"name": "Some Designer", "class": ""},
425*e1fe3e4aSElliott Hughes        ]
426*e1fe3e4aSElliott Hughes    ),
427*e1fe3e4aSElliott Hughes    "woffMetadataDescription": dict(
428*e1fe3e4aSElliott Hughes        url="http://somefoundry.com/foo/description",
429*e1fe3e4aSElliott Hughes        text=[
430*e1fe3e4aSElliott Hughes            dict(text="foo"),
431*e1fe3e4aSElliott Hughes            dict(text=""),
432*e1fe3e4aSElliott Hughes            dict(text="foo", language="bar"),
433*e1fe3e4aSElliott Hughes            dict(text="foo", language=""),
434*e1fe3e4aSElliott Hughes            dict(text="foo", dir="ltr"),
435*e1fe3e4aSElliott Hughes            dict(text="foo", dir="rtl"),
436*e1fe3e4aSElliott Hughes            {"text": "foo", "class": "foo"},
437*e1fe3e4aSElliott Hughes            {"text": "foo", "class": ""},
438*e1fe3e4aSElliott Hughes        ],
439*e1fe3e4aSElliott Hughes    ),
440*e1fe3e4aSElliott Hughes    "woffMetadataLicense": dict(
441*e1fe3e4aSElliott Hughes        url="http://somefoundry.com/foo/license",
442*e1fe3e4aSElliott Hughes        id="foo",
443*e1fe3e4aSElliott Hughes        text=[
444*e1fe3e4aSElliott Hughes            dict(text="foo"),
445*e1fe3e4aSElliott Hughes            dict(text=""),
446*e1fe3e4aSElliott Hughes            dict(text="foo", language="bar"),
447*e1fe3e4aSElliott Hughes            dict(text="foo", language=""),
448*e1fe3e4aSElliott Hughes            dict(text="foo", dir="ltr"),
449*e1fe3e4aSElliott Hughes            dict(text="foo", dir="rtl"),
450*e1fe3e4aSElliott Hughes            {"text": "foo", "class": "foo"},
451*e1fe3e4aSElliott Hughes            {"text": "foo", "class": ""},
452*e1fe3e4aSElliott Hughes        ],
453*e1fe3e4aSElliott Hughes    ),
454*e1fe3e4aSElliott Hughes    "woffMetadataCopyright": dict(
455*e1fe3e4aSElliott Hughes        text=[
456*e1fe3e4aSElliott Hughes            dict(text="foo"),
457*e1fe3e4aSElliott Hughes            dict(text=""),
458*e1fe3e4aSElliott Hughes            dict(text="foo", language="bar"),
459*e1fe3e4aSElliott Hughes            dict(text="foo", language=""),
460*e1fe3e4aSElliott Hughes            dict(text="foo", dir="ltr"),
461*e1fe3e4aSElliott Hughes            dict(text="foo", dir="rtl"),
462*e1fe3e4aSElliott Hughes            {"text": "foo", "class": "foo"},
463*e1fe3e4aSElliott Hughes            {"text": "foo", "class": ""},
464*e1fe3e4aSElliott Hughes        ]
465*e1fe3e4aSElliott Hughes    ),
466*e1fe3e4aSElliott Hughes    "woffMetadataTrademark": dict(
467*e1fe3e4aSElliott Hughes        text=[
468*e1fe3e4aSElliott Hughes            dict(text="foo"),
469*e1fe3e4aSElliott Hughes            dict(text=""),
470*e1fe3e4aSElliott Hughes            dict(text="foo", language="bar"),
471*e1fe3e4aSElliott Hughes            dict(text="foo", language=""),
472*e1fe3e4aSElliott Hughes            dict(text="foo", dir="ltr"),
473*e1fe3e4aSElliott Hughes            dict(text="foo", dir="rtl"),
474*e1fe3e4aSElliott Hughes            {"text": "foo", "class": "foo"},
475*e1fe3e4aSElliott Hughes            {"text": "foo", "class": ""},
476*e1fe3e4aSElliott Hughes        ]
477*e1fe3e4aSElliott Hughes    ),
478*e1fe3e4aSElliott Hughes    "woffMetadataLicensee": dict(name="Some Licensee"),
479*e1fe3e4aSElliott Hughes    "woffMetadataExtensions": [
480*e1fe3e4aSElliott Hughes        dict(
481*e1fe3e4aSElliott Hughes            # everything
482*e1fe3e4aSElliott Hughes            names=[
483*e1fe3e4aSElliott Hughes                dict(text="foo"),
484*e1fe3e4aSElliott Hughes                dict(text=""),
485*e1fe3e4aSElliott Hughes                dict(text="foo", language="bar"),
486*e1fe3e4aSElliott Hughes                dict(text="foo", language=""),
487*e1fe3e4aSElliott Hughes                dict(text="foo", dir="ltr"),
488*e1fe3e4aSElliott Hughes                dict(text="foo", dir="rtl"),
489*e1fe3e4aSElliott Hughes                {"text": "foo", "class": "hello"},
490*e1fe3e4aSElliott Hughes                {"text": "foo", "class": ""},
491*e1fe3e4aSElliott Hughes            ],
492*e1fe3e4aSElliott Hughes            items=[
493*e1fe3e4aSElliott Hughes                # everything
494*e1fe3e4aSElliott Hughes                dict(
495*e1fe3e4aSElliott Hughes                    id="foo",
496*e1fe3e4aSElliott Hughes                    names=[
497*e1fe3e4aSElliott Hughes                        dict(text="foo"),
498*e1fe3e4aSElliott Hughes                        dict(text=""),
499*e1fe3e4aSElliott Hughes                        dict(text="foo", language="bar"),
500*e1fe3e4aSElliott Hughes                        dict(text="foo", language=""),
501*e1fe3e4aSElliott Hughes                        dict(text="foo", dir="ltr"),
502*e1fe3e4aSElliott Hughes                        dict(text="foo", dir="rtl"),
503*e1fe3e4aSElliott Hughes                        {"text": "foo", "class": "hello"},
504*e1fe3e4aSElliott Hughes                        {"text": "foo", "class": ""},
505*e1fe3e4aSElliott Hughes                    ],
506*e1fe3e4aSElliott Hughes                    values=[
507*e1fe3e4aSElliott Hughes                        dict(text="foo"),
508*e1fe3e4aSElliott Hughes                        dict(text=""),
509*e1fe3e4aSElliott Hughes                        dict(text="foo", language="bar"),
510*e1fe3e4aSElliott Hughes                        dict(text="foo", language=""),
511*e1fe3e4aSElliott Hughes                        dict(text="foo", dir="ltr"),
512*e1fe3e4aSElliott Hughes                        dict(text="foo", dir="rtl"),
513*e1fe3e4aSElliott Hughes                        {"text": "foo", "class": "hello"},
514*e1fe3e4aSElliott Hughes                        {"text": "foo", "class": ""},
515*e1fe3e4aSElliott Hughes                    ],
516*e1fe3e4aSElliott Hughes                ),
517*e1fe3e4aSElliott Hughes                # no id
518*e1fe3e4aSElliott Hughes                dict(names=[dict(text="foo")], values=[dict(text="foo")]),
519*e1fe3e4aSElliott Hughes            ],
520*e1fe3e4aSElliott Hughes        ),
521*e1fe3e4aSElliott Hughes        # no names
522*e1fe3e4aSElliott Hughes        dict(
523*e1fe3e4aSElliott Hughes            items=[dict(id="foo", names=[dict(text="foo")], values=[dict(text="foo")])]
524*e1fe3e4aSElliott Hughes        ),
525*e1fe3e4aSElliott Hughes    ],
526*e1fe3e4aSElliott Hughes    "guidelines": [
527*e1fe3e4aSElliott Hughes        # ints
528*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45),
529*e1fe3e4aSElliott Hughes        # floats
530*e1fe3e4aSElliott Hughes        dict(x=100.5, y=200.5, angle=45.5),
531*e1fe3e4aSElliott Hughes        # edges
532*e1fe3e4aSElliott Hughes        dict(x=0, y=0, angle=0),
533*e1fe3e4aSElliott Hughes        dict(x=0, y=0, angle=360),
534*e1fe3e4aSElliott Hughes        dict(x=0, y=0, angle=360.0),
535*e1fe3e4aSElliott Hughes        # no y
536*e1fe3e4aSElliott Hughes        dict(x=100),
537*e1fe3e4aSElliott Hughes        # no x
538*e1fe3e4aSElliott Hughes        dict(y=200),
539*e1fe3e4aSElliott Hughes        # name
540*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, name="foo"),
541*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, name=""),
542*e1fe3e4aSElliott Hughes        # identifier
543*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, identifier="guide1"),
544*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, identifier="guide2"),
545*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, identifier="\x20"),
546*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, identifier="\x7E"),
547*e1fe3e4aSElliott Hughes        # colors
548*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="0,0,0,0"),
549*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="1,0,0,0"),
550*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="1,1,1,1"),
551*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="0,1,0,0"),
552*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="0,0,1,0"),
553*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="0,0,0,1"),
554*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="1, 0, 0, 0"),
555*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="0, 1, 0, 0"),
556*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="0, 0, 1, 0"),
557*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="0, 0, 0, 1"),
558*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color=".5,0,0,0"),
559*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="0,.5,0,0"),
560*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="0,0,.5,0"),
561*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="0,0,0,.5"),
562*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color=".5,1,1,1"),
563*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="1,.5,1,1"),
564*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="1,1,.5,1"),
565*e1fe3e4aSElliott Hughes        dict(x=100, y=200, angle=45, color="1,1,1,.5"),
566*e1fe3e4aSElliott Hughes    ],
567*e1fe3e4aSElliott Hughes}
568*e1fe3e4aSElliott Hughes
569*e1fe3e4aSElliott HughesexpectedFontInfo1To2Conversion = {
570*e1fe3e4aSElliott Hughes    "familyName": "Some Font (Family Name)",
571*e1fe3e4aSElliott Hughes    "styleMapFamilyName": "Some Font Regular (Style Map Family Name)",
572*e1fe3e4aSElliott Hughes    "styleMapStyleName": "regular",
573*e1fe3e4aSElliott Hughes    "styleName": "Regular (Style Name)",
574*e1fe3e4aSElliott Hughes    "unitsPerEm": 1000,
575*e1fe3e4aSElliott Hughes    "ascender": 750,
576*e1fe3e4aSElliott Hughes    "capHeight": 750,
577*e1fe3e4aSElliott Hughes    "xHeight": 500,
578*e1fe3e4aSElliott Hughes    "descender": -250,
579*e1fe3e4aSElliott Hughes    "italicAngle": -12.5,
580*e1fe3e4aSElliott Hughes    "versionMajor": 1,
581*e1fe3e4aSElliott Hughes    "versionMinor": 0,
582*e1fe3e4aSElliott Hughes    "year": 2008,
583*e1fe3e4aSElliott Hughes    "copyright": "Copyright Some Foundry.",
584*e1fe3e4aSElliott Hughes    "trademark": "Trademark Some Foundry",
585*e1fe3e4aSElliott Hughes    "note": "A note.",
586*e1fe3e4aSElliott Hughes    "macintoshFONDFamilyID": 15000,
587*e1fe3e4aSElliott Hughes    "macintoshFONDName": "SomeFont Regular (FOND Name)",
588*e1fe3e4aSElliott Hughes    "openTypeNameCompatibleFullName": "Some Font Regular (Compatible Full Name)",
589*e1fe3e4aSElliott Hughes    "openTypeNameDescription": "Some Font by Some Designer for Some Foundry.",
590*e1fe3e4aSElliott Hughes    "openTypeNameDesigner": "Some Designer",
591*e1fe3e4aSElliott Hughes    "openTypeNameDesignerURL": "http://somedesigner.com",
592*e1fe3e4aSElliott Hughes    "openTypeNameLicense": "License info for Some Foundry.",
593*e1fe3e4aSElliott Hughes    "openTypeNameLicenseURL": "http://somefoundry.com/license",
594*e1fe3e4aSElliott Hughes    "openTypeNameManufacturer": "Some Foundry",
595*e1fe3e4aSElliott Hughes    "openTypeNameManufacturerURL": "http://somefoundry.com",
596*e1fe3e4aSElliott Hughes    "openTypeNamePreferredFamilyName": "Some Font (Preferred Family Name)",
597*e1fe3e4aSElliott Hughes    "openTypeNamePreferredSubfamilyName": "Regular (Preferred Subfamily Name)",
598*e1fe3e4aSElliott Hughes    "openTypeNameCompatibleFullName": "Some Font Regular (Compatible Full Name)",
599*e1fe3e4aSElliott Hughes    "openTypeNameUniqueID": "OpenType name Table Unique ID",
600*e1fe3e4aSElliott Hughes    "openTypeNameVersion": "OpenType name Table Version",
601*e1fe3e4aSElliott Hughes    "openTypeOS2VendorID": "SOME",
602*e1fe3e4aSElliott Hughes    "openTypeOS2WeightClass": 500,
603*e1fe3e4aSElliott Hughes    "openTypeOS2WidthClass": 5,
604*e1fe3e4aSElliott Hughes    "postscriptDefaultWidthX": 400,
605*e1fe3e4aSElliott Hughes    "postscriptFontName": "SomeFont-Regular (Postscript Font Name)",
606*e1fe3e4aSElliott Hughes    "postscriptFullName": "Some Font-Regular (Postscript Full Name)",
607*e1fe3e4aSElliott Hughes    "postscriptSlantAngle": -12.5,
608*e1fe3e4aSElliott Hughes    "postscriptUniqueID": 4000000,
609*e1fe3e4aSElliott Hughes    "postscriptWeightName": "Medium",
610*e1fe3e4aSElliott Hughes    "postscriptWindowsCharacterSet": 1,
611*e1fe3e4aSElliott Hughes}
612*e1fe3e4aSElliott Hughes
613*e1fe3e4aSElliott HughesexpectedFontInfo2To1Conversion = {
614*e1fe3e4aSElliott Hughes    "familyName": "Some Font (Family Name)",
615*e1fe3e4aSElliott Hughes    "menuName": "Some Font Regular (Style Map Family Name)",
616*e1fe3e4aSElliott Hughes    "fontStyle": 64,
617*e1fe3e4aSElliott Hughes    "styleName": "Regular (Style Name)",
618*e1fe3e4aSElliott Hughes    "unitsPerEm": 1000,
619*e1fe3e4aSElliott Hughes    "ascender": 750,
620*e1fe3e4aSElliott Hughes    "capHeight": 750,
621*e1fe3e4aSElliott Hughes    "xHeight": 500,
622*e1fe3e4aSElliott Hughes    "descender": -250,
623*e1fe3e4aSElliott Hughes    "italicAngle": -12.5,
624*e1fe3e4aSElliott Hughes    "versionMajor": 1,
625*e1fe3e4aSElliott Hughes    "versionMinor": 0,
626*e1fe3e4aSElliott Hughes    "copyright": "Copyright Some Foundry.",
627*e1fe3e4aSElliott Hughes    "trademark": "Trademark Some Foundry",
628*e1fe3e4aSElliott Hughes    "note": "A note.",
629*e1fe3e4aSElliott Hughes    "fondID": 15000,
630*e1fe3e4aSElliott Hughes    "fondName": "SomeFont Regular (FOND Name)",
631*e1fe3e4aSElliott Hughes    "fullName": "Some Font Regular (Compatible Full Name)",
632*e1fe3e4aSElliott Hughes    "notice": "Some Font by Some Designer for Some Foundry.",
633*e1fe3e4aSElliott Hughes    "designer": "Some Designer",
634*e1fe3e4aSElliott Hughes    "designerURL": "http://somedesigner.com",
635*e1fe3e4aSElliott Hughes    "license": "License info for Some Foundry.",
636*e1fe3e4aSElliott Hughes    "licenseURL": "http://somefoundry.com/license",
637*e1fe3e4aSElliott Hughes    "createdBy": "Some Foundry",
638*e1fe3e4aSElliott Hughes    "vendorURL": "http://somefoundry.com",
639*e1fe3e4aSElliott Hughes    "otFamilyName": "Some Font (Preferred Family Name)",
640*e1fe3e4aSElliott Hughes    "otStyleName": "Regular (Preferred Subfamily Name)",
641*e1fe3e4aSElliott Hughes    "otMacName": "Some Font Regular (Compatible Full Name)",
642*e1fe3e4aSElliott Hughes    "ttUniqueID": "OpenType name Table Unique ID",
643*e1fe3e4aSElliott Hughes    "ttVersion": "OpenType name Table Version",
644*e1fe3e4aSElliott Hughes    "ttVendor": "SOME",
645*e1fe3e4aSElliott Hughes    "weightValue": 500,
646*e1fe3e4aSElliott Hughes    "widthName": "Medium (normal)",
647*e1fe3e4aSElliott Hughes    "defaultWidth": 400,
648*e1fe3e4aSElliott Hughes    "fontName": "SomeFont-Regular (Postscript Font Name)",
649*e1fe3e4aSElliott Hughes    "fullName": "Some Font-Regular (Postscript Full Name)",
650*e1fe3e4aSElliott Hughes    "slantAngle": -12.5,
651*e1fe3e4aSElliott Hughes    "uniqueID": 4000000,
652*e1fe3e4aSElliott Hughes    "weightName": "Medium",
653*e1fe3e4aSElliott Hughes    "msCharSet": 0,
654*e1fe3e4aSElliott Hughes    "year": 2008,
655*e1fe3e4aSElliott Hughes}
656