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:
parent
3be66f59d6
commit
04de155aaa
2 changed files with 14 additions and 15 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue