Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

refractor(paste):font-import-localized

Aswin Asokcf433e9a8eb0
diff --git a/web/apps/paste/public/fonts/gochi-hand-latin.woff2 b/web/apps/paste/public/fonts/gochi-hand-latin.woff2
new file mode 100644
index 0000000000..b929dadca9
Binary files /dev/null and b/web/apps/paste/public/fonts/gochi-hand-latin.woff2 differ
diff --git a/web/apps/paste/src/app/styles/fonts.css b/web/apps/paste/src/app/styles/fonts.css
new file mode 100644
index 0000000000..09d73f2083
--- /dev/null
+++ b/web/apps/paste/src/app/styles/fonts.css
@@ -0,0 +1,11 @@
+@font-face {
+ font-family: "Gochi Hand";
+ font-style: normal;
+ font-display: swap;
+ font-weight: 400;
+ src: url("/fonts/gochi-hand-latin.woff2") format("woff2");
+ unicode-range:
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
+ U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
+ U+2212, U+2215, U+FEFF, U+FFFD;
+}
diff --git a/web/apps/paste/src/pages/_app.tsx b/web/apps/paste/src/pages/_app.tsx
index cb5b995246..2772d010d3 100644
--- a/web/apps/paste/src/pages/_app.tsx
+++ b/web/apps/paste/src/pages/_app.tsx
@@ -1,4 +1,5 @@
import "@fontsource-variable/inter";
+import "app/styles/fonts.css";
import { CssBaseline } from "@mui/material";
import { ThemeProvider } from "@mui/material/styles";
import { CustomHead } from "ente-base/components/Head";
@@ -12,7 +13,15 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
return (
<ThemeProvider theme={shareTheme} defaultMode="dark">
- <CustomHead title="Ente Paste" />
+ <CustomHead title="Ente Paste">
+ <link
+ rel="preload"
+ href="/fonts/gochi-hand-latin.woff2"
+ as="font"
+ type="font/woff2"
+ crossOrigin="anonymous"
+ />
+ </CustomHead>
<CssBaseline enableColorScheme />
<Component {...pageProps} />
</ThemeProvider>
diff --git a/web/apps/paste/src/pages/index.tsx b/web/apps/paste/src/pages/index.tsx
index 18944bb352..b190ff5645 100644
--- a/web/apps/paste/src/pages/index.tsx
+++ b/web/apps/paste/src/pages/index.tsx
@@ -44,16 +44,6 @@ const Page = () => {
name="twitter:image"
content="https://paste.ente.com/images/metaimage.png"
/>
- <link rel="preconnect" href="https://fonts.googleapis.com" />
- <link
- rel="preconnect"
- href="https://fonts.gstatic.com"
- crossOrigin="anonymous"
- />
- <link
- href="https://fonts.googleapis.com/css2?family=Gochi+Hand&display=swap"
- rel="stylesheet"
- />
</Head>
<PasteFrame footer={<PasteFooter />}>
diff --git a/web/apps/paste/tsconfig.json b/web/apps/paste/tsconfig.json
index f6be56cfbf..9b61ac0d2f 100644
--- a/web/apps/paste/tsconfig.json
+++ b/web/apps/paste/tsconfig.json
@@ -1,10 +1,18 @@
{
- "extends": "ente-build-config/tsconfig-next.json",
- "compilerOptions": { "baseUrl": "./src" },
- "include": [
- "src",
- "next-env.d.ts",
- "../../packages/base/global-electron.d.ts",
- "../../packages/base/components/utils/mui-theme.d.ts"
+ "extends": "ente-build-config/tsconfig-next.json",
+ "compilerOptions": {
+ "baseUrl": "./src",
+ "plugins": [
+ {
+ "name": "next"
+ }
]
+ },
+ "include": [
+ "../../packages/base/components/utils/mui-theme.d.ts",
+ "../../packages/base/global-electron.d.ts",
+ "next-env.d.ts",
+ "src",
+ ".next/types/**/*.ts"
+ ]
}