1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Merge pull request #17934 from calixteman/warn_invalid_name

Warn when a non-embedded font has an invalid name
This commit is contained in:
Tim van der Meij 2024-04-12 14:15:02 +02:00 committed by GitHub
commit 2e94511330
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;