Add texture drop cap pagination
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user