Skip to content

Remove uses of font.get_charmap #5410

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
Nov 5, 2015

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Nov 5, 2015

This is a follow-on to #5299 and removes all other uses of FT2Font.get_charmap in the code base (and these ones were a lot easier). Again, this helps a lot with large Unicode fonts since we don't have to generate a large dictionary just to access the handful of characters any one plot contains.

@mdboom mdboom added this to the next major release (2.0) milestone Nov 5, 2015
@@ -1,8 +1,6 @@
"""
font data tables for truetype and afm computer modern fonts
"""
# this dict maps symbol names to fontnames, glyphindex. To get the
# glyph index from the character code, you have to use get_charmap
Copy link
Member Author

Choose a reason for hiding this comment

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

This comment is out of date and should have been removed in #5299.

@WeatherGod
Copy link
Member

looks good to me. Is this intended to be backported anywhere?

@WeatherGod
Copy link
Member

also, is there any plan to mark get_charmap() as deprecated, or to suggest the use of font.get_char_index()?

@mdboom
Copy link
Member Author

mdboom commented Nov 5, 2015

Is this intended to be backported anywhere?

Yes, to 2.0 which can benefit from this for the larger fonts.

also, is there any plan to mark get_charmap() as deprecated, or to suggest the use of font.get_char_index()?

Longer term (probably 2.1, though I'm not promising that as a dealine), this will all be replaced by matplotlib/freetypy. See my freetypy branch.

tacaswell added a commit that referenced this pull request Nov 5, 2015
MNT: Remove uses of font.get_charmap
@tacaswell tacaswell merged commit 240850a into matplotlib:master Nov 5, 2015
@tacaswell
Copy link
Member

This does not backport cleanly, I will have a PR soon

tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Nov 5, 2015
MNT: Remove uses of font.get_charmap

Conflicts:
    lib/matplotlib/tests/test_font_manager.py

Conflicts with merging the tests, resloved to add only relavent code.
WeatherGod added a commit that referenced this pull request Nov 5, 2015
Merge pull request #5410 from mdboom/get-charmap-removal
@mdboom mdboom deleted the get-charmap-removal branch November 10, 2015 02:40
@QuLogic
Copy link
Member

QuLogic commented Oct 16, 2016

Backported via #5412.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants