Skip to content

Wrong symbols from a TrueType font #2870

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

Closed
mojca opened this issue Mar 5, 2014 · 3 comments
Closed

Wrong symbols from a TrueType font #2870

mojca opened this issue Mar 5, 2014 · 3 comments
Milestone

Comments

@mojca
Copy link

mojca commented Mar 5, 2014

When I figured out that OpenType fonts wouldn't work, I found LucidaBrightRegular.ttf in Java and tried to use it with

matplotlib.rcParams['font.family'] = 'Lucida Bright'
plt.title('abc [def](ghi)')

(I actually need this for something like plt.xlabel('length [cm]').)

But this is what I get in PDF, the closing parenthesis are rotated and displaced (or maybe the wrong symbol is used):

wrong_symbols

while PNG and native GUI on Mac OS X work fine. I'm using the latest matplotlib (9fea430) with Python 3.3.

Related issue: #2869

@mdboom
Copy link
Member

mdboom commented Mar 18, 2014

This font declares the right bracket and parentheses as a copy of the left bracket with a different affine transformation applied. Unfortunately, our font subsetting tool, ttconv, does not support this case. Using freetype for this (as described in #2869) would probably fix this problem, but I don't think there is an easier fix. As a workaround, setting pdf.fonttype to 42 (to turn off font subsetting) works, or you can use the Cairo backend.

@mdboom mdboom closed this as completed Mar 18, 2014
@mojca
Copy link
Author

mojca commented Mar 18, 2014

Thanks a lot for the hint, rcParams['pdf.fonttype'] = 42 saved my day. (I wish I knew about that option earlier, I spent a couple of hours trying to make an OpenType font work.)

Cairo isn't an option as it doesn't support the kind of graphics I'm using in my plot.

@jkseppan
Copy link
Member

jkseppan commented Aug 1, 2020

Fix in #18081

@QuLogic QuLogic added this to the v3.4.0 milestone Aug 4, 2020
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

No branches or pull requests

4 participants