Skip to content

Conversation

@jenshnielsen
Copy link
Member

This fixes #3669 for me. It looks like CharacterComplement doesn't return a valid unicode string so make it a bytestring in python3

This happens to me for the standard matplotlib font matplotlib/mpl-data/fonts/ttf/Vera.ttf
not sure why it doesn't happen on travis.

In any case 'characterComplement' is '\xff\xff\xff\xff6\xff\xff\xfe628R00' for this font on both python2 and python3 which looks rather strange to me. I expected this to be a string of all chars that this font contains so perhaps there is a deeper issue?

Looks like CharacterComplement doesn't return a unicode string so make it a bytestring in python3
@tacaswell tacaswell added this to the v1.5.x milestone Oct 18, 2014
@mdboom
Copy link
Member

mdboom commented Oct 20, 2014

Looks good. Thanks!

mdboom added a commit that referenced this pull request Oct 20, 2014
fix for #3669 Font issue without PyCXX
@mdboom mdboom merged commit 4aa6b7e into matplotlib:master Oct 20, 2014
@mdboom
Copy link
Member

mdboom commented Oct 20, 2014

characterComplement is essentially a bitfield. See here:

http://www.microsoft.com/typography/otspec/pclt.htm

If we wanted to provide a really Pythonic API to it, it would probably be a list of bools or something. But matplotlib itself doesn't even use this, and it's part of matplotlib's public API so I didn't want to change it (well, not intentionally).

@jenshnielsen
Copy link
Member Author

Thanks for the explanation. I didn't manage to google a good explanation of CharacterComplement

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.

Test faliures after merging the decxx branch (#3646)

4 participants