1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Flush the current chunk when the font changed because of a restore op (issue #14755)

This commit is contained in:
Calixte Denizet 2023-05-18 17:22:42 +02:00
parent 356f3cf285
commit 3091e70aad
4 changed files with 85 additions and 0 deletions

View file

@ -2991,6 +2991,8 @@ class PartialEvaluator {
if (!preprocessor.read(operation)) {
break;
}
const previousState = textState;
textState = stateManager.state;
const fn = operation.fn;
args = operation.args;
@ -3362,6 +3364,16 @@ class PartialEvaluator {
});
}
break;
case OPS.restore:
if (
previousState &&
(previousState.font !== textState.font ||
previousState.fontSize !== textState.fontSize ||
previousState.fontName !== textState.fontName)
) {
flushTextContentItem();
}
break;
} // switch
if (textContent.items.length >= sink.desiredSize) {
// Wait for ready, if we reach highWaterMark.