mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-09 20:12:26 +10:00
Fixed issue [Bug] <Error MIME al cargar fuente “Arial” desde Google Fonts en exportaciones públicas>
Fixes #2435
This commit is contained in:
@ -1,8 +1,8 @@
|
|||||||
|
import { isLocalFont } from "@reactive-resume/utils";
|
||||||
import { useEffect, useMemo } from "react";
|
import { useEffect, useMemo } from "react";
|
||||||
import { Helmet } from "react-helmet-async";
|
import { Helmet } from "react-helmet-async";
|
||||||
import { Outlet } from "react-router";
|
import { Outlet } from "react-router";
|
||||||
import webfontloader from "webfontloader";
|
import webfontloader from "webfontloader";
|
||||||
import { isLocalFont } from "@reactive-resume/utils";
|
|
||||||
|
|
||||||
import { useArtboardStore } from "../store/artboard";
|
import { useArtboardStore } from "../store/artboard";
|
||||||
|
|
||||||
@ -21,11 +21,14 @@ export const ArtboardPage = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const family = metadata.typography.font.family;
|
const family = metadata.typography.font.family;
|
||||||
if (isLocalFont(family)) {
|
if (isLocalFont(family)) {
|
||||||
|
let frame = 0;
|
||||||
|
frame = requestAnimationFrame(() => {
|
||||||
const width = window.document.body.offsetWidth;
|
const width = window.document.body.offsetWidth;
|
||||||
const height = window.document.body.offsetHeight;
|
const height = window.document.body.offsetHeight;
|
||||||
const message = { type: "PAGE_LOADED", payload: { width, height } };
|
const message = { type: "PAGE_LOADED", payload: { width, height } };
|
||||||
window.postMessage(message, "*");
|
window.postMessage(message, "*");
|
||||||
return;
|
});
|
||||||
|
return () => { cancelAnimationFrame(frame); };
|
||||||
}
|
}
|
||||||
|
|
||||||
webfontloader.load({
|
webfontloader.load({
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { describe, it, expect } from "vitest";
|
import { describe, expect,it } from "vitest";
|
||||||
|
|
||||||
import { isLocalFont, localFonts } from "../fonts";
|
import { isLocalFont, localFonts } from "../fonts";
|
||||||
|
|
||||||
describe("isLocalFont", () => {
|
describe("isLocalFont", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user