Merge pull request #1895 from dscorbett/legacy-agl

[agl] Support legacy glyph names
This commit is contained in:
Cosimo Lupo 2020-04-25 15:11:17 +01:00 committed by GitHub
commit 1f77e96478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4365 additions and 34 deletions

File diff suppressed because it is too large Load Diff

View File

@ -7,21 +7,15 @@ import unittest
class AglToUnicodeTest(unittest.TestCase):
def test_spec_examples(self):
# https://github.com/adobe-type-tools/agl-specification#3-examples
#
# TODO: Currently, we only handle AGLFN instead of legacy AGL names.
# Therefore, the test cases below use Iogonek instead of Lcommaaccent.
# Change Iogonek to Lcommaaccent as soon as the implementation has
# been fixed to also support legacy AGL names.
# https://github.com/fonttools/fonttools/issues/775
self.assertEqual(agl.toUnicode("Iogonek"), "Į")
self.assertEqual(agl.toUnicode("Lcommaaccent"), "Ļ")
self.assertEqual(agl.toUnicode("uni20AC0308"), "\u20AC\u0308")
self.assertEqual(agl.toUnicode("u1040C"), "\U0001040C")
self.assertEqual(agl.toUnicode("uniD801DC0C"), "")
self.assertEqual(agl.toUnicode("uni20ac"), "")
self.assertEqual(
agl.toUnicode("Iogonek_uni20AC0308_u1040C.alternate"),
"\u012E\u20AC\u0308\U0001040C")
self.assertEqual(agl.toUnicode("Iogonek_uni012E_u012E"), "ĮĮĮ")
agl.toUnicode("Lcommaaccent_uni20AC0308_u1040C.alternate"),
"\u013B\u20AC\u0308\U0001040C")
self.assertEqual(agl.toUnicode("Lcommaaccent_uni013B_u013B"), "ĻĻĻ")
self.assertEqual(agl.toUnicode("foo"), "")
self.assertEqual(agl.toUnicode(".notdef"), "")