mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-09 08:35:47 +02:00
Replace a few cases of "manual" font name normalization with the normalizeFontName helper function
This commit is contained in:
parent
e9c509aca9
commit
6a3d5fea6c
@ -4463,7 +4463,7 @@ class PartialEvaluator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Using base font name as a font name.
|
// Using base font name as a font name.
|
||||||
baseFontName = baseFontName.name.replaceAll(/[,_]/g, "-");
|
baseFontName = normalizeFontName(baseFontName.name);
|
||||||
const metrics = this.getBaseFontMetrics(baseFontName);
|
const metrics = this.getBaseFontMetrics(baseFontName);
|
||||||
|
|
||||||
// Simulating descriptor flags attribute
|
// Simulating descriptor flags attribute
|
||||||
|
|||||||
@ -992,7 +992,7 @@ class Font {
|
|||||||
nonStdFontMap = getNonStdFontMap(),
|
nonStdFontMap = getNonStdFontMap(),
|
||||||
serifFonts = getSerifFonts();
|
serifFonts = getSerifFonts();
|
||||||
for (const namePart of name.split("+")) {
|
for (const namePart of name.split("+")) {
|
||||||
let fontName = namePart.replaceAll(/[,_]/g, "-");
|
let fontName = normalizeFontName(namePart);
|
||||||
fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName;
|
fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName;
|
||||||
fontName = fontName.split("-", 1)[0];
|
fontName = fontName.split("-", 1)[0];
|
||||||
if (serifFonts[fontName]) {
|
if (serifFonts[fontName]) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user