diff --git a/src/render/canvas/canvas-renderer.ts b/src/render/canvas/canvas-renderer.ts index 6efb648..609d8a7 100644 --- a/src/render/canvas/canvas-renderer.ts +++ b/src/render/canvas/canvas-renderer.ts @@ -146,11 +146,11 @@ export class CanvasRenderer extends Renderer { renderTextWithLetterSpacing(text: TextBounds, letterSpacing: number, baseline: number): void { if (letterSpacing === 0) { - this.ctx.fillText(text.text, text.bounds.left, text.bounds.top + baseline); + this.ctx.fillText(text.text, text.bounds.left, text.bounds.top - text.bounds.height / 2 + baseline); } else { const letters = segmentGraphemes(text.text); letters.reduce((left, letter) => { - this.ctx.fillText(letter, left, text.bounds.top + baseline); + this.ctx.fillText(letter, left, text.bounds.top - text.bounds.height / 2 + baseline); return left + this.ctx.measureText(letter).width; }, text.bounds.left);