diff --git a/src/render/font-metrics.ts b/src/render/font-metrics.ts index f40555c..9eed95a 100644 --- a/src/render/font-metrics.ts +++ b/src/render/font-metrics.ts @@ -47,7 +47,7 @@ export class FontMetrics { span.appendChild(this._document.createTextNode(SAMPLE_TEXT)); container.appendChild(span); container.appendChild(img); - const baseline = img.offsetTop - span.offsetTop + 2; + const baseline = img.offsetTop - span.offsetTop + 1; container.removeChild(span); container.appendChild(this._document.createTextNode(SAMPLE_TEXT)); @@ -55,7 +55,7 @@ export class FontMetrics { container.style.lineHeight = 'normal'; img.style.verticalAlign = 'super'; - const middle = img.offsetTop - container.offsetTop + 2; + const middle = img.offsetTop - container.offsetTop + 1; body.removeChild(container);