Skip to content

Commit

Permalink
添加Inter字体支持,替换SSFangTangTi字体引用
Browse files Browse the repository at this point in the history
  • Loading branch information
Shua-github committed Dec 29, 2024
1 parent cf652bc commit 0df7480
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SSFangTangTi from "./fonts/ShangShouFangTangTi.woff2";
import Inter from "./fonts/Inter.woff2";
import "./App.css";
import Canvas from "./components/Canvas";
import { useState, useEffect } from "react";
Expand All @@ -21,7 +21,7 @@ function App() {
let controller;
try {
controller = new AbortController();
preloadFont("SSFangTangTi", SSFangTangTi, controller.signal);
preloadFont("Inter", Inter, controller.signal);
} catch (error) {
console.error(error);
} finally {
Expand Down
Binary file added src/fonts/Inter.woff2
Binary file not shown.
5 changes: 5 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ body {
@font-face {
font-family: 'SSFangTangTi';
src: local('SSFangTangTi'), url(./fonts/ShangShouFangTangTi.woff2) format('woff2');
}

@font-face {
font-family: 'Inter';
src: local('Inter'), url(./fonts/Inter.woff2) format('woff2');
}

0 comments on commit 0df7480

Please sign in to comment.