Skip to content

Commit

Permalink
Merge pull request #17934 from calixteman/warn_invalid_name
Browse files Browse the repository at this point in the history
Warn when a non-embedded font has an invalid name
  • Loading branch information
timvandermeij authored Apr 12, 2024
2 parents e005e6e + acc5649 commit 2e94511
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/font_substitutions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2e94511

Please sign in to comment.