mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Warn when a non-embedded font has an invalid name
It can be helpful to find out some heuristics when trying to find a substitution font.
This commit is contained in:
parent
e005e6ecdd
commit
acc56491c9
1 changed files with 2 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
|
||||
import { normalizeFontName } from "./fonts_utils.js";
|
||||
import { validateFontName } from "./core_utils.js";
|
||||
import { warn } from "../shared/util.js";
|
||||
|
||||
const NORMAL = {
|
||||
style: "normal",
|
||||
|
@ -513,6 +514,7 @@ function getFontSubstitution(
|
|||
const loadedName = `${idFactory.getDocId()}_s${idFactory.createFontId()}`;
|
||||
if (!substitution) {
|
||||
if (!validateFontName(baseFontName)) {
|
||||
warn(`Cannot substitute the font because of its name: ${baseFontName}`);
|
||||
systemFontCache.set(key, null);
|
||||
// If the baseFontName is not valid we don't want to use it.
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue