Use non-xxxVF paths in t2cstr when flattening and outputting CFF2 #1588
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
handleBlend()
in shared/t2cstr.c "handles" flattening by adjusting values on the stack. Because it doesn't copy theblendValues
into theopEntry
in the flatten mode, you do wind up withnumBlends
equaling zero in that entry but you wind up with the default invalue
rather than the blended value.Perhaps
handleBlend()
should also adjust theopEntry->value
in the flatten case, but I'm reluctant to do that because it seems like the value may be cross-referenced in other places. And while this would fix our stem calculation problems it appears that the curveto case is more complicated and would need additional work.Anyway, there's no real point to using the blend when we're flattening.
So instead this PR just avoids using the blends entirely when calling out downstream (moveto, lineto, curveto, stemto) in the flattening case. Instead of calling the xxxxVF variant we just call the normal "flat" one. (It also skips the "preparatory" work in
t2decode()
.) That will work fine with CFF2 -- in factcffwrite
does that optimization when there are no blends anyway.I was going to add a CFF2 instancing test for this but it turns out we don't (appear to?) have any instancing tests right now. So I filed #1587 instead, as what should go into those tests is more than I want to think about while we're sorting through VF hinting.
Checklist: