-
Notifications
You must be signed in to change notification settings - Fork 475
[cffLib] Fix for #1451
#1456
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
[cffLib] Fix for #1451 #1456
Conversation
…tecodes 11 and 14 can be part of an encoded numeric value; so remove 'return' or 'endchar' at the program level instead of bytescode
The "if not isCFF2" test later could actually be the else clause of this new if. That error could be raised even before compilation starts. |
Yes, let me incorporate that change in this PR. |
if isCFF2: | ||
# If present, remove return and endchar operators. | ||
if program and program[-1] in ("return", "endchar"): | ||
program = program[:-1] |
There 8000 was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
del program[-1]
would avoid the copy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but I thought it was nicer to not alter self.program. But I can change it if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, you mean, in case the reference to program
list was shared by some other object.. Ok, let's leave it like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to desc 9F6E ribe this comment to others. Learn more.
I tested with SourceSerifProVF and this works, thanks Just!
A charstring is not guaranteed to end in an operator, so the final bytecodes 11 and 14 can be part of an encoded numeric value; so remove 'return' or 'endchar' at the program level instead of bytecode.
Fixes next issue from #1451