-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add entry for .notdef to CharStrings for type 42 fonts in eps files. … #9059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
extern/ttconv/pprdrv_tt.cpp
Outdated
@@ -1055,7 +1055,9 @@ void ttfont_CharStrings(TTStreamWriter& stream, struct TTFONT *font, std::vector | |||
post_format = getFixed( font->post_table ); | |||
|
|||
/* Emmit the start of the PostScript code to define the dictionary. */ | |||
stream.printf("/CharStrings %d dict dup begin\n", glyph_ids.size()); | |||
stream.printf("/CharStrings %d dict dup begin\n", glyph_ids.size()+1); | |||
/* PS Lang Ref says ChatStrings must contain an entry for .notdef */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be 'CharStrings'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is section 5.8.2 table 5.7 that has this requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks for catching that and for the section / table suggestion. I tried fixing/squashing/pushing. I haven't done many PRs, so if I made a mistake and you can fix it please do. Thanks for matplotlib. I use it and pandas at work instead of IDL and it makes my work easier to do
@selasley You are a hero for tracking this down! I just left 2 small doc-related comments (a typo and can you add the section/table information). I can also take care of this and push to your branch if you want. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in docs + reference to PS spec
@mdboom Is there an upstream we should push this to? |
…in eps files. See issue matplotlib#9044
8b6a6cc
to
bfea3a6
Compare
@selasley I think this is your first matplotlib contribution (sorry if I am wrong). Congratulations 🎉 Hopefully we will hear from you again! Thank you again for tracking this down. |
@tacaswell @efiring when will these changes make their way into a conda release - do you guys mint nightlies? |
No nightlies. 2.1rc1 is expected by the end of the month, though. |
… See issue #9044
PR Summary
According to the Postscript Language Ref CharStrings dictionaries for Type 42 fonts "must have an entry whose key is .notdef". The lack of this entry caused several macOS apps to fail to open eps files created with ps.fonttype = 42. This PR modifies ppdrvr_tt.cpp to add an entry for .notdef to the CharStrings dict.
#9044
PR Checklist