Skip to content
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

Update buildcff2vf #825

Merged
merged 3 commits into from
Jun 28, 2019
Merged

Update buildcff2vf #825

merged 3 commits into from
Jun 28, 2019

Conversation

readroberts
Copy link
Contributor

Address issue 816: wrong set of masters referenced when fixing compatibility issues, if default master is not the first font the master font list.
Address issue 817: fix unintentional filtering of features when using the subsetting option.

Copy link
Contributor

@cjchapman cjchapman left a comment

Choose a reason for hiding this comment

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

For now I've only looked at the Codacy report and requested some changes based on it. I'll plan on doing a closer review after you've made these changes. Thanks.

python/afdko/buildcff2vf.py Outdated Show resolved Hide resolved
python/afdko/buildcff2vf.py Show resolved Hide resolved
python/afdko/buildcff2vf.py Outdated Show resolved Hide resolved
python/afdko/buildcff2vf.py Outdated Show resolved Hide resolved
python/afdko/buildcff2vf.py Show resolved Hide resolved
@cjchapman
Copy link
Contributor

Also, the flake8 report has a few things from above and a few new things:

$ flake8 python/afdko/buildcff2vf.py 
python/afdko/buildcff2vf.py:146:52: E226 missing whitespace around arithmetic operator
python/afdko/buildcff2vf.py:146:54: E226 missing whitespace around arithmetic operator
python/afdko/buildcff2vf.py:146:72: E226 missing whitespace around arithmetic operator
python/afdko/buildcff2vf.py:146:74: E226 missing whitespace around arithmetic operator
python/afdko/buildcff2vf.py:159:13: F841 local variable 'prev_coords' is assigned to but never used
python/afdko/buildcff2vf.py:258:80: E501 line too long (89 > 79 characters)
python/afdko/buildcff2vf.py:297:56: W291 trailing whitespace
python/afdko/buildcff2vf.py:336:80: E501 line too long (84 > 79 characters)

@readroberts
Copy link
Contributor Author

@cjchapman @miguelsousa I fixed the Codacy and flake8 issues. I see the first two builds failed, but it looks like it is an issue with the build environment rather than the code.

…tion

Fixing outline compatibility can fail because the code assumes that the first font in the master_fonts argument to do_compatibility() is the default. Fix by passing in the default font index in the font list into do_compatibilization(), so that the region font list can be formed by deleting the actual default font from the font list. Fix same issue in CompatibilityPen.getCharStrings().
Add test case.

Fixes #816
@cjchapman
Copy link
Contributor

@readroberts (cc: @miguelsousa) this branch was trying to use the miguelsousa fork of cibuildwheel which no longer exists, so I've cherry-picked the change back to the adobe-type-tools fork from the develop branch to this branch.

@cjchapman
Copy link
Contributor

@readroberts (cc: @miguelsousa) Correction: I've rebased this branch off the develop branch to pick up the change. (Sorry, I was spaced, I really shouldn't look at GitHub this late in the day.)

@cjchapman cjchapman dismissed their stale review June 28, 2019 03:56

I'm dismissing my earlier review because the changes I requested have been made, and now I've touched this branch to fix the CI issues, so I think someone else should do the final approval of this branch.

A side effect of using the fontTools subsetter module to implement glyph subsetting with the -i option is that features are removed if they are not in the subsetter default features set. Since buildcff2vf is not intended to filter out features, I fixed this by setting the subsetter module's layout_features option field to '*', which causes it to pass through all features.

Add test case.

Fixes #817
When a point is a curve in one master source font and a line in another, the code will convert the line to a flat curve. However, the code in the class CompatibilityPen assumes that the point coordinates are absolute. A few months ago, I changed the parent class CFF2CharStringMergePen (in fontTools)  from using absolute to relative coordinates, and forgot about this dependency.

Also fixed the test cases that use the compatibilization option.
@miguelsousa
Copy link
Member

I've reworked the commits. Should be ready for @josh-hadley to review.

Copy link
Collaborator

@josh-hadley josh-hadley left a comment

Choose a reason for hiding this comment

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

I have nothing consequential to add here. LGTM.

@miguelsousa miguelsousa merged commit 500c031 into develop Jun 28, 2019
@miguelsousa miguelsousa deleted the update-buildcff2vf branch June 28, 2019 15:51
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