Replace a few cases of "manual" font name normalization with the normalizeFontName helper function

This commit is contained in:
Jonas Jenwald 2026-02-08 16:53:10 +01:00
parent e9c509aca9
commit 6a3d5fea6c
2 changed files with 2 additions and 2 deletions

View File

@ -4463,7 +4463,7 @@ class PartialEvaluator {
}
// Using base font name as a font name.
baseFontName = baseFontName.name.replaceAll(/[,_]/g, "-");
baseFontName = normalizeFontName(baseFontName.name);
const metrics = this.getBaseFontMetrics(baseFontName);
// Simulating descriptor flags attribute

View File

@ -992,7 +992,7 @@ class Font {
nonStdFontMap = getNonStdFontMap(),
serifFonts = getSerifFonts();
for (const namePart of name.split("+")) {
let fontName = namePart.replaceAll(/[,_]/g, "-");
let fontName = normalizeFontName(namePart);
fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName;
fontName = fontName.split("-", 1)[0];
if (serifFonts[fontName]) {