Browse Source

更新了一个vfonts依赖库,优化字体性能

ZaiZai 2 years ago
parent
commit
1a076a4bc9
3 changed files with 10 additions and 9 deletions
  1. 2 2
      package.json
  2. 3 2
      src/styles/font/index.scss
  3. 5 5
      yarn.lock

+ 2 - 2
package.json

@@ -34,7 +34,7 @@
         "tailwindcss": "3.1.8",
         "unplugin-auto-import": "^0.15.1",
         "unplugin-vue-components": "^0.24.1",
-        "vfonts": "^0.0.3",
-        "vite": "^4.1.4"
+        "vite": "^4.1.4",
+        "z-vfonts": "^0.0.1"
     }
 }

+ 3 - 2
src/styles/font/index.scss

@@ -1,7 +1,7 @@
 // 通用字体
-@import 'vfonts/Lato.css';
+@import 'z-vfonts/Lato.css';
 // 等宽字体
-@import 'vfonts/FiraCode.css';
+@import 'z-vfonts/FiraCode.css';
 
 html, body, * {
     font-family: v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
@@ -11,6 +11,7 @@ html, body, * {
 @font-face {
     font-family: "EUDC";
     src: url('./EUDC.ttf') format('truetype');
+    font-display: swap;
 }
 
 //特殊字符代码的字体

+ 5 - 5
yarn.lock

@@ -1393,11 +1393,6 @@ utrie@^1.0.2:
   dependencies:
     base64-arraybuffer "^1.0.2"
 
-vfonts@^0.0.3:
-  version "0.0.3"
-  resolved "https://registry.yarnpkg.com/vfonts/-/vfonts-0.0.3.tgz#999d66fecea18efee3f2b966c81101ae8ce01a29"
-  integrity sha512-nguyw8L6Un8eelg1vQ31vIU2ESxqid7EYmy8V+MDeMaHBqaRSkg3dTBToC1PR00D89UzS/SLkfYPnx0Wf23IQQ==
-
 vite@^4.1.4:
   version "4.1.4"
   resolved "https://registry.npmmirror.com/vite/-/vite-4.1.4.tgz#170d93bcff97e0ebc09764c053eebe130bfe6ca0"
@@ -1470,6 +1465,11 @@ yaml@^1.10.2:
   resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
   integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
 
+z-vfonts@^0.0.1:
+  version "0.0.1"
+  resolved "https://registry.npmjs.org/z-vfonts/-/z-vfonts-0.0.1.tgz#b2bc35d5e21ced42e4240715fbcb3f9545253c36"
+  integrity sha512-KfpKVzP5Xl4vGRwQHPMl2rPFIEcOII+5/4UVj9ns/Uw7eKeP9YPI8XKpjd/KNgiC7KSHvCcUpddeUfI4Jr8oOA==
+
 zrender@5.4.1:
   version "5.4.1"
   resolved "https://registry.npmmirror.com/zrender/-/zrender-5.4.1.tgz#892f864b885c71e1dc25dcb3c7a4ba42678d3f11"