8000 Recognize abbreviations of PostScript code · matplotlib/matplotlib@19119d8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 19119d8

Browse files
committed
Recognize abbreviations of PostScript code
Type-1 fonts are required to have subroutines with specific contents but their names may vary. They are usually ND, NP and RD but names like | and |- appear too.
1 parent 90e7a50 commit 19119d8

File tree

2 files changed

+136
-113
lines changed

2 files changed

+136
-113
lines changed

lib/matplotlib/tests/test_type1font.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def test_Type1Font():
4141
assert slanted.prop['ItalicAngle'] == -45
4242
assert font.prop['Encoding'][5] == 'Pi'
4343
assert isinstance(font.prop['CharStrings']['Pi'], bytes)
44+
assert font._abbr['ND'] == 'ND'
4445

4546
differ = difflib.Differ()
4647
diff = list(differ.compare(
@@ -84,6 +85,7 @@ def test_Type1Font_2():
8485
assert font.prop['Encoding'][65] == 'A' # the font uses StandardEncoding
8586
(pos0, pos1), = font._pos['Encoding']
8687
assert font.parts[0][pos0:pos1] == b'/Encoding StandardEncoding'
88+
assert font._abbr['ND'] == '|-'
8789

8890

8991
def test_overprecision():

0 commit comments

Comments
 (0)
0