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