Skip to content

Commit

Permalink
Merge pull request mozilla#12270 from janpe2/type1-accents
Browse files Browse the repository at this point in the history
Accent positioning in Type1 `seac` glyphs
  • Loading branch information
timvandermeij authored Aug 24, 2020
2 parents 0f4fc12 + e7febbf commit 34cec29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/core/type1_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ var Type1CharString = (function Type1CharStringClosure() {
// seac is like type 2's special endchar but it doesn't use the
// first argument asb, so remove it.
if (seacAnalysisEnabled) {
const asb = this.stack[this.stack.length - 5];
this.seac = this.stack.splice(-4, 4);
this.seac[0] += this.lsb - asb;
error = this.executeCommand(0, COMMAND_MAP.endchar);
} else {
error = this.executeCommand(4, COMMAND_MAP.endchar);
Expand Down
6 changes: 4 additions & 2 deletions src/display/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -1798,8 +1798,10 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
} else {
this.paintChar(character, scaledX, scaledY, patternTransform);
if (accent) {
scaledAccentX = scaledX + accent.offset.x / fontSizeScale;
scaledAccentY = scaledY - accent.offset.y / fontSizeScale;
scaledAccentX =
scaledX + (fontSize * accent.offset.x) / fontSizeScale;
scaledAccentY =
scaledY - (fontSize * accent.offset.y) / fontSizeScale;
this.paintChar(
accent.fontChar,
scaledAccentX,
Expand Down

0 comments on commit 34cec29

Please sign in to comment.