Correct WebGL dropcap texture layout

This commit is contained in:
2026-06-07 17:59:01 +02:00
parent da37608197
commit 7abd3387f3
5 changed files with 8 additions and 6 deletions
+2 -3
View File
@@ -264,7 +264,8 @@ class BookPaginationModule extends BaseModule {
const inkRight = Number.isFinite(metrics.actualBoundingBoxRight) && metrics.actualBoundingBoxRight > 0
? metrics.actualBoundingBoxRight
: (metrics.width || 0);
return Math.max(inkRight, lineHeightPx * 1.08) + this.measureNormalTextGap(fontPx);
const advanceWidth = metrics.width || 0;
return Math.max(inkRight, advanceWidth, lineHeightPx * 1.08) + this.measureNormalTextGap(fontPx);
}
measureNormalTextGap(fontPx) {
@@ -355,8 +356,6 @@ class BookPaginationModule extends BaseModule {
fragments.push(node.value || '');
} else if (node.type === 'glue' && node.width > 0) {
fragments.push(' ');
} else if (node.type === 'penalty' && node.penalty === 100) {
fragments.push('|');
}
}
return fragments.join('').replace(/\s+/g, ' ').trimStart();