Skip to content

Fix TrueType to Type-3 font conversion #905

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 5 commits into from
May 31, 2012

Conversation

jkseppan
Copy link
Member

The code did not handle correctly glyph contours where the first
point was off-path. This changes the conversion algorithm to a
hopefully clearer one, which explicitly inserts all implicit on-path
points between off-path ones as a first step before outputting the
PostScript code.

I hope this fixes issue #903.

@jkseppan
Copy link
Member Author

The submitter of #903 says this fixes the issue. Maybe @mdboom wants to take a look, since he has by far the most commits in ttconv.

@mdboom
Copy link
Member

mdboom commented May 29, 2012

Looks good -- all tests are passing, so it doesn't seem to have inadvertently changed anything about the fonts we already ship. Any thoughts about how to add a test case this, short of including FreeSans? (We can't include it because it's GPL'd).

@jkseppan
Copy link
Member Author

I created a fake font with FontForge and made a test case that renders it in a large size. Interestingly, if you enable svg output in the test, there are artifacts there that look like the svg version is not handling correctly the case where contours consist of control points only.

@jkseppan
Copy link
Member Author

The png and pdf output are offset horizontally, but I suspect that the metrics of my fake font are just garbage, which could be causing different handling in different backends.

@mdboom
Copy link
Member

mdboom commented May 29, 2012

Nice. All I would add is that maybe the test font should go under the test tree, rather than installing it alongside the other fonts. You can pass a full path to the ttf file to the font manager mechanism to load it without it being in the font cache.

jkseppan and others added 5 commits May 30, 2012 11:46
The code did not handle correctly glyph contours where the first
point was off-path. This changes the conversion algorithm to a
hopefully clearer one, which explicitly inserts all implicit on-path
points between off-path ones as a first step before outputting the
PostScript code.
If I enable svg, I see artifacts in the resulting file that look
like there are similar bugs as matplotlib#903 in svg.
…s freetype versions, and also it doesn't actually test ttconv, wihch is not used by the Agg backend.
@mdboom
Copy link
Member

mdboom commented May 31, 2012

Great! I think this is good to merge.

jkseppan added a commit that referenced this pull request May 31, 2012
Fix TrueType to Type-3 font conversion
@jkseppan jkseppan merged commit 7ba1965 into matplotlib:v1.1.x May 31, 2012
mdboom added a commit to mdboom/matplotlib that referenced this pull request Jun 6, 2012
… their last point as an initial MOVETO. This is the SVG-specific corrolory to matplotlib#905.
This was referenced Jun 6, 2012
mdboom added a commit that referenced this pull request Jun 7, 2012
…t point as an initial MOVETO. This is the SVG-specific corrolory to #905.
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.

2 participants