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

Merge CFF rebased #2447

Merged
merged 12 commits into from
Nov 19, 2021
Merged

Merge CFF rebased #2447

merged 12 commits into from
Nov 19, 2021

Conversation

khaledhosny
Copy link
Collaborator

@khaledhosny khaledhosny commented Nov 10, 2021

Rebased #1319, but had to remove .notdef non-duplication since it conflicts with the change made in #1729 and needs bigger change to do properly.

TODO:

  • Add tests
  • Fix any blocking XXX

@khaledhosny khaledhosny mentioned this pull request Nov 10, 2021
@khaledhosny
Copy link
Collaborator Author

I’m not getting duplicate .notdef glyphs, so I’m not even sure what this code was about.

Lib/fontTools/merge.py Outdated Show resolved Hide resolved
Copy link
Member

@anthrotype anthrotype left a comment

Choose a reason for hiding this comment

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

Thanks Khaled for picking this up. It's been a while since I have read this code, I left some comment below

Lib/fontTools/merge.py Outdated Show resolved Hide resolved
Lib/fontTools/merge.py Show resolved Hide resolved
Lib/fontTools/merge.py Outdated Show resolved Hide resolved
Lib/fontTools/merge.py Outdated Show resolved Hide resolved
Lib/fontTools/merge.py Outdated Show resolved Hide resolved
Lib/fontTools/merge.py Outdated Show resolved Hide resolved
Lib/fontTools/merge.py Outdated Show resolved Hide resolved
@behdad
Copy link
Member

behdad commented Nov 11, 2021

LGTM. Thanks Khaled.

@khaledhosny khaledhosny force-pushed the merge-cff-rebased branch 3 times, most recently from b9e0b7f to fa0b30f Compare November 17, 2021 05:10
# Rename CFF CharStrings to match the new glyphOrder.
# Using cffTable before reloading the fonts, because reasons.
Copy link
Member

Choose a reason for hiding this comment

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

Using cffTable before reloading the fonts, because reasons.

a bit cryptic, perhaps intentionally so. But as far as I can tell, you are actually cffTable after reloading, so I'm even more confused by the comment.

Copy link
Member

Choose a reason for hiding this comment

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

ah I now see. You are using the cffTable from the original fonts, before they have been reloaded. Ok, then why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. I don’t fully understand what is going on, but if we don’t do this then duplicated glyphs gets messed up (they seem to be using the outlines from the first font) in the output font. This seems to be related to the font reloading step, if we stop doing this then all this becomes moot. My testing does not show any other difference with or without reloading.

@anthrotype
Copy link
Member

@khaledhosny are you planning to add some minimal tests as well?

@khaledhosny
Copy link
Collaborator Author

@khaledhosny are you planning to add some minimal tests as well?

I want to add tests, but merge module does not have any integration tests and I’m not sure unit tests will be very helpful here. If I can figure an easy way to add some integration tests, I’ll do that.

We are not doing anything about subroutines (and there shouldn’t be any
since the tables are desubroutinized), so this code is just making it
look noisy.
Lib/fontTools/merge.py Show resolved Hide resolved
@khaledhosny khaledhosny merged commit 0a7164a into main Nov 19, 2021
@khaledhosny khaledhosny deleted the merge-cff-rebased branch November 19, 2021 12:20
@anthrotype
Copy link
Member

Thanks Jeremie and Khaled!

@behdad behdad mentioned this pull request Apr 1, 2022
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.

None yet

4 participants