From 6a3d5fea6c3e667dc76479329f3d27ec40dbc053 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 8 Feb 2026 16:53:10 +0100 Subject: [PATCH] Replace a few cases of "manual" font name normalization with the `normalizeFontName` helper function --- src/core/evaluator.js | 2 +- src/core/fonts.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/evaluator.js b/src/core/evaluator.js index c717b20cb..833cf63d7 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -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 diff --git a/src/core/fonts.js b/src/core/fonts.js index a155ac702..fb1b8fe59 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -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]) {