Repository navigation
Compute glyph widths similarly in Type 42 as in Type 3 - #7961
Conversation
|
guinea pig for new appveyor integration |
|
It seems the new job got fired (https://ci.appveyor.com/project/matplotlib/matplotlib) but the CI box is still showing the link to the old one. I assume this is just transient configuration getting crossed and the next PR will only file the new one (as I turned off the webhook to Mike's account). |
QuLogic
left a comment
There was a problem hiding this comment.
I don't know where this 6 originated, but I came to the same conclusion earlier.
| @@ -1040,8 +1040,9 @@ def embedTTFType42(font, characters, descriptor): | |||
| for c in characters: | |||
| ccode = c | |||
There was a problem hiding this comment.
The only suggestion I have is to clean this up; ccode can just be the name at the beginning of the loop.
|
Actually, was just thinking we should probably add a test for this. |
|
👍 for a test |
Adapted from the code samples in matplotlib#7937 by @TomDLT and @afvincent.
|
Added a test case, but it can only test that the results of the type-42 embedding stay the same as they are after this change, not that they are correct. |
|
Thanks @jkseppan ! |
Compute glyph widths similarly in Type 42 as in Type 3
|
backported in v2.0.x via 9b6f7c1 |
Here's my reasoning: Issue #7937 points out that text spacing is different between Type 42 and Type 3 embeddings of ttf fonts, and Type 3 looks better. One way to make them similar is to avoid the font cache and load a new
FT2Fontobject, so I think the problem is that other users of these objects callset_sizeand that affects the glyph widths observed by this backend. Type 3 embeddings are not affected, and they use theLOAD_NO_SCALEflag, so here I change the Type 42 code to do the same and convert the sizes similarly.In truth I have no clue how TrueType fonts work, so please review carefully.