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

Slightly shorten the loadedName-ids used with font-substitutions

Generally we try to keep the ids that we create short, hence we can slightly shorten the "static" part of them.
This commit is contained in:
Jonas Jenwald 2023-05-18 22:13:15 +02:00
parent 3be66f59d6
commit 04de155aaa
2 changed files with 14 additions and 15 deletions

View file

@ -400,8 +400,6 @@ function getFontSubstitution(
baseFontName,
standardFontName
) {
let mustAddBaseFont = false;
// It's possible to have a font name with spaces, commas or dashes, hence we
// just replace them by a dash.
baseFontName = normalizeFontName(baseFontName);
@ -426,13 +424,14 @@ function getFontSubstitution(
}
}
let mustAddBaseFont = false;
if (!substitution) {
// If not, check if we've a substitution for the standard font.
substitution = substitutionMap.get(standardFontName);
mustAddBaseFont = true;
}
const loadedName = `${idFactory.getDocId()}_sf_${idFactory.createFontId()}`;
const loadedName = `${idFactory.getDocId()}_s${idFactory.createFontId()}`;
if (!substitution) {
if (!validateFontName(baseFontName)) {
systemFontCache.set(key, null);