mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Merge pull request #15659 from sxyuan/system-font-name-fix
[api-minor] Propagate the translated font name to TextContentItem for system fonts
This commit is contained in:
commit
f7449563ef
2 changed files with 10 additions and 4 deletions
|
@ -2425,8 +2425,7 @@ class PartialEvaluator {
|
|||
if (textContentItem.initialized) {
|
||||
return textContentItem;
|
||||
}
|
||||
const font = textState.font,
|
||||
loadedName = font.loadedName;
|
||||
const { font, loadedName } = textState;
|
||||
if (!seenStyles.has(loadedName)) {
|
||||
seenStyles.add(loadedName);
|
||||
|
||||
|
@ -2539,6 +2538,7 @@ class PartialEvaluator {
|
|||
});
|
||||
})
|
||||
.then(function (translated) {
|
||||
textState.loadedName = translated.loadedName;
|
||||
textState.font = translated.font;
|
||||
textState.fontMatrix =
|
||||
translated.font.fontMatrix || FONT_IDENTITY_MATRIX;
|
||||
|
@ -2872,7 +2872,7 @@ class PartialEvaluator {
|
|||
width: 0,
|
||||
height: 0,
|
||||
transform: getCurrentTextTransform(),
|
||||
fontName: textState.font.loadedName,
|
||||
fontName: textState.loadedName,
|
||||
hasEOL: true,
|
||||
});
|
||||
}
|
||||
|
@ -4602,6 +4602,7 @@ class TextState {
|
|||
this.ctm = new Float32Array(IDENTITY_MATRIX);
|
||||
this.fontName = null;
|
||||
this.fontSize = 0;
|
||||
this.loadedName = null;
|
||||
this.font = null;
|
||||
this.fontMatrix = FONT_IDENTITY_MATRIX;
|
||||
this.textMatrix = IDENTITY_MATRIX.slice();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue