Skip to content

Commit

Permalink
fix: scoping issue on phase variable (#1557)
Browse files Browse the repository at this point in the history
I also have an open PR to fontkit. foliojs/fontkit#267
  • Loading branch information
ericponto committed Nov 7, 2021
1 parent 24ca9d4 commit b536a2e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/fontkit/src/glyph/CFFGlyph.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ export default class CFFGlyph extends Glyph {
break;

case 30: // vhcurveto
case 31: // hvcurveto
phase = op === 31;
case 31: { // hvcurveto
let phase = op === 31;
while (stack.length >= 4) {
if (phase) {
c1x = x + stack.shift();
Expand All @@ -343,6 +343,7 @@ export default class CFFGlyph extends Glyph {
phase = !phase;
}
break;
}

case 12:
op = stream.readUInt8();
Expand Down

0 comments on commit b536a2e

Please sign in to comment.