mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: skip registering font faces for local fonts (#8303)
This commit is contained in:
parent
e844580b14
commit
80ea7ca23f
1 changed files with 7 additions and 2 deletions
|
@ -151,8 +151,13 @@ export class Fonts {
|
||||||
private static async loadFontFaces(
|
private static async loadFontFaces(
|
||||||
fontFamilies: Array<ExcalidrawTextElement["fontFamily"]>,
|
fontFamilies: Array<ExcalidrawTextElement["fontFamily"]>,
|
||||||
) {
|
) {
|
||||||
// Add all registered font faces into the `document.fonts` (if not added already)
|
// add all registered font faces into the `document.fonts` (if not added already)
|
||||||
for (const { fonts } of Fonts.registered.values()) {
|
for (const { fonts, metadata } of Fonts.registered.values()) {
|
||||||
|
// skip registering font faces for local fonts (i.e. Helvetica)
|
||||||
|
if (metadata.local) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for (const { fontFace } of fonts) {
|
for (const { fontFace } of fonts) {
|
||||||
if (!window.document.fonts.has(fontFace)) {
|
if (!window.document.fonts.has(fontFace)) {
|
||||||
window.document.fonts.add(fontFace);
|
window.document.fonts.add(fontFace);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue