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
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
import { normalizeFontName } from "./fonts_utils.js";
|
import { normalizeFontName } from "./fonts_utils.js";
|
||||||
import { validateFontName } from "./core_utils.js";
|
import { validateFontName } from "./core_utils.js";
|
||||||
|
import { warn } from "../shared/util.js";
|
||||||
|
|
||||||
const NORMAL = {
|
const NORMAL = {
|
||||||
style: "normal",
|
style: "normal",
|
||||||
@ -513,6 +514,7 @@ function getFontSubstitution(
|
|||||||
const loadedName = `${idFactory.getDocId()}_s${idFactory.createFontId()}`;
|
const loadedName = `${idFactory.getDocId()}_s${idFactory.createFontId()}`;
|
||||||
if (!substitution) {
|
if (!substitution) {
|
||||||
if (!validateFontName(baseFontName)) {
|
if (!validateFontName(baseFontName)) {
|
||||||
|
warn(`Cannot substitute the font because of its name: ${baseFontName}`);
|
||||||
systemFontCache.set(key, null);
|
systemFontCache.set(key, null);
|
||||||
// If the baseFontName is not valid we don't want to use it.
|
// If the baseFontName is not valid we don't want to use it.
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user