Add texture drop cap pagination

This commit is contained in:
2026-06-06 15:39:53 +02:00
parent 431e305df9
commit 1b8c8f8bce
4 changed files with 40 additions and 7 deletions
+12
View File
@@ -159,6 +159,18 @@ class BookTextureRendererModule extends BaseModule {
let wordIndex = 0;
ctx.font = `${fontStyle}${fontPx}px ${metrics.typography.fontFamily}`;
if (lineRecord.dropCapText) {
ctx.save();
ctx.font = `${Math.round(lineHeightPx * 2.08)}px "EB Garamond Initials", ${metrics.typography.fontFamily}`;
ctx.textBaseline = 'top';
ctx.fillText(
String(lineRecord.dropCapText),
metrics.content.x,
metrics.content.y + (Number(lineRecord.pageLine || 0) * lineHeightPx) - (lineHeightPx * 0.08)
);
ctx.restore();
ctx.font = `${fontStyle}${fontPx}px ${metrics.typography.fontFamily}`;
}
nodes.forEach((node, index) => {
if (!node) return;
if (node.type === 'box' && node.value) {