Skip to content

Commit

Permalink
cleaning + update render tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislawpuda-tomtom committed Nov 11, 2024
1 parent 08ff664 commit e0030d9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
38 changes: 14 additions & 24 deletions src/symbol/shaping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ function shapeLines(shaping: Shaping,
const section = line.getSection(i);
const sectionIndex = line.getSectionIndex(i);
const codePoint = line.getCharCode(i);

let baselineOffset = 0.0;
let metrics: GlyphMetrics | null = null;
let rect = null;
Expand Down Expand Up @@ -776,34 +777,23 @@ function shapeLines(shaping: Shaping,
}
}

positionedGlyphs.push({
glyph: codePoint,
imageName,
x,
y: y + baselineOffset + SHAPING_DEFAULT_OFFSET,
vertical,
scale: section.scale,
fontStack: section.fontStack,
sectionIndex,
metrics,
rect
});

if (!vertical) {
positionedGlyphs.push({
glyph: codePoint,
imageName,
x,
y: y + baselineOffset + SHAPING_DEFAULT_OFFSET,
vertical,
scale: section.scale,
fontStack: section.fontStack,
sectionIndex,
metrics,
rect
});
x += metrics.advance * section.scale + spacing;
} else {
shaping.verticalizable = true;
positionedGlyphs.push({
glyph: codePoint,
imageName,
x,
y: y + baselineOffset + SHAPING_DEFAULT_OFFSET,
vertical,
scale: section.scale,
fontStack: section.fontStack,
sectionIndex,
metrics,
rect
});
x += verticalAdvance * section.scale + spacing;
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e0030d9

Please sign in to comment.