Vendor the font

This commit is contained in:
Mewp 2025-02-10 00:11:09 +01:00 committed by mewp
parent 8158b6817e
commit 39f994fc0b
4 changed files with 2 additions and 29 deletions

View file

@ -1,15 +0,0 @@
diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx
index 52feac9..f502906 100644
--- a/src/app/[locale]/layout.tsx
+++ b/src/app/[locale]/layout.tsx
@@ -7,9 +7,9 @@ import Head from 'next/head';
import { ThemeProvider } from "@/components/providers";
import { translations } from "@/i18n/translations";
-import { Oxanium } from "next/font/google";
+import localFont from "next/font/local";
import { headers } from "next/headers";
-const oxanium = Oxanium({ subsets: ["latin-ext"] })
+const oxanium = localFont({ src: './Oxanium.ttf' })
import type { Metadata } from 'next';

View file

@ -5,24 +5,12 @@ in pkgs.buildNpmPackage {
version = package-json.version;
src = ./.;
patches = [ ./build-with-nix.patch ];
preBuild = ''
cp "${
pkgs.google-fonts.override { fonts = [ "Oxanium" ]; }
}/share/fonts/truetype/Oxanium[wght].ttf" src/app/\[locale\]/Oxanium.ttf
'';
npmDeps = pkgs.importNpmLock {
npmRoot = ./.;
};
npmConfigHook = pkgs.importNpmLock.npmConfigHook;
nativeBuildInputs = with pkgs; [
keepBuildTree
];
installPhase = ''
cp -r public $out/
mkdir $out/.next

Binary file not shown.

View file

@ -7,9 +7,9 @@ import Head from 'next/head';
import { ThemeProvider } from "@/components/providers";
import { translations } from "@/i18n/translations";
import { Oxanium } from "next/font/google";
import localFont from "next/font/local";
import { headers } from "next/headers";
const oxanium = Oxanium({ subsets: ["latin-ext"] })
const oxanium = localFont({ src: './Oxanium.ttf' })
import type { Metadata } from 'next';