Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/core/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -989,10 +989,14 @@ class Font {
// Fallback to checking the font name, in order to improve text-selection,
// since the /Flags-entry is often wrong (fixes issue13845.pdf).
if (!isSerifFont && !properties.isSimulatedFlags) {
const baseName = name.replaceAll(/[,_]/g, "-").split("-", 1)[0],
const stdFontMap = getStdFontMap(),
nonStdFontMap = getNonStdFontMap(),
serifFonts = getSerifFonts();
for (const namePart of baseName.split("+")) {
if (serifFonts[namePart]) {
for (const namePart of name.split("+")) {
let fontName = namePart.replaceAll(/[,_]/g, "-");
fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName;
fontName = fontName.split("-", 1)[0];
if (serifFonts[fontName]) {
isSerifFont = true;
break;
}
Expand Down
Loading