mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-21 20:21:32 +10:00
FIxed bug [Bug] <Error MIME al cargar fuente “Arial” desde Google Fonts en exportaciones públicas>
Fixes #2435
This commit is contained in:
@ -2,6 +2,7 @@ import { useEffect, useMemo } from "react";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
import { Outlet } from "react-router";
|
||||
import webfontloader from "webfontloader";
|
||||
import { isLocalFont } from "@reactive-resume/utils";
|
||||
|
||||
import { useArtboardStore } from "../store/artboard";
|
||||
|
||||
@ -18,6 +19,15 @@ export const ArtboardPage = () => {
|
||||
}, [metadata.typography.font]);
|
||||
|
||||
useEffect(() => {
|
||||
const family = metadata.typography.font.family;
|
||||
if (isLocalFont(family)) {
|
||||
const width = window.document.body.offsetWidth;
|
||||
const height = window.document.body.offsetHeight;
|
||||
const message = { type: "PAGE_LOADED", payload: { width, height } };
|
||||
window.postMessage(message, "*");
|
||||
return;
|
||||
}
|
||||
|
||||
webfontloader.load({
|
||||
google: { families: [fontString] },
|
||||
active: () => {
|
||||
|
||||
Reference in New Issue
Block a user