Correct WebGL dropcap texture layout
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user