Skip to content

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

Merged
merged 1 commit into from
Aug 21, 2017

Conversation

selasley
Copy link
Contributor

… 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

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@dopplershift dopplershift added this to the 2.1 (next point release) milestone Aug 18, 2017
@dopplershift dopplershift added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Aug 18, 2017
@@ -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 */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 'CharStrings'?

Copy link
Member

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.

Copy link
Contributor Author

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

@tacaswell
Copy link
Member

@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.

Copy link
Member

@tacaswell tacaswell left a 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

@tacaswell
Copy link
Member

@mdboom Is there an upstream we should push this to?

@efiring efiring merged commit 21bbf8c into matplotlib:master Aug 21, 2017
@tacaswell
Copy link
Member

@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.

@durack1
Copy link

durack1 commented Aug 23, 2017

@tacaswell @efiring when will these changes make their way into a conda release - do you guys mint nightlies?

@efiring
Copy link
Member

efiring commented Aug 24, 2017

No nightlies. 2.1rc1 is expected by the end of the month, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants