Просмотр исходного кода

replace SourceHanCodeJP with the subset fonts

Yuki Takei 2 лет назад
Родитель
Сommit
c3636eda8f

+ 3 - 0
apps/app/resource/fonts/SourceHanCodeJP-Regular-subset-jis2.woff2

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bdac758ab1d3ebbb0051915be4f4cb06f7514205c08b584120ccda5f35158a12
+size 604872

+ 3 - 0
apps/app/resource/fonts/SourceHanCodeJP-Regular-subset-main.woff2

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3deb0f43a8a5fb29be39c629e63249a9346db0c45e75754e6d018e6548343b85
+size 513096

+ 0 - 3
apps/app/resource/fonts/SourceHanCodeJP-Regular.woff2

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d4b582d043b48510614205db1f1bc1519a70acbe0d89f53843e9131fe7f655b8
-size 3333108

+ 9 - 2
apps/app/src/pages/_app.page.tsx

@@ -33,7 +33,14 @@ const lato = Lato({
   subsets: ['latin'],
   display: 'swap',
 });
-const sourceHanCodeJP = localFont({ src: '../../resource/fonts/SourceHanCodeJP-Regular.woff2' });
+const sourceHanCodeJPSubsetMain = localFont({
+  src: '../../resource/fonts/SourceHanCodeJP-Regular-subset-main.woff2',
+  display: 'optional',
+});
+const sourceHanCodeJPSubsetJis2 = localFont({
+  src: '../../resource/fonts/SourceHanCodeJP-Regular-subset-jis2.woff2',
+  display: 'optional',
+});
 
 // eslint-disable-next-line @typescript-eslint/ban-types
 export type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {
@@ -72,7 +79,7 @@ function GrowiApp({ Component, pageProps }: GrowiAppProps): JSX.Element {
         :root {
           --font-family-sans-serif: ${lato.style.fontFamily}, -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
           --font-family-serif: Georgia, 'Times New Roman', Times, serif;
-          --font-family-monospace: monospace, ${sourceHanCodeJP.style.fontFamily};
+          --font-family-monospace: monospace, ${sourceHanCodeJPSubsetMain.style.fontFamily}, ${sourceHanCodeJPSubsetJis2.style.fontFamily};
         }
       `}</style>
       <SWRConfig value={swrGlobalConfiguration}>