about summary refs log tree commit diff
path: root/src/alf/util
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-10-17 14:32:53 -0500
committerGitHub <noreply@github.com>2024-10-17 14:32:53 -0500
commit7ca1789d6f17c99f718ea1a7c1aa838307e72b6d (patch)
tree5c70e5db0ab1435b147793ca148ff1b4a5bd203a /src/alf/util
parent834beac58c4206e2cb573a40ed2d151bc3eeefbe (diff)
downloadvoidsky-7ca1789d6f17c99f718ea1a7c1aa838307e72b6d.tar.zst
Fix font display on Android (#5776)
* Fix font display on Android

* Format

* Split out fake fonts hook for platforms
Diffstat (limited to 'src/alf/util')
-rw-r--r--src/alf/util/unusedUseFonts.android.ts19
-rw-r--r--src/alf/util/unusedUseFonts.ts15
2 files changed, 34 insertions, 0 deletions
diff --git a/src/alf/util/unusedUseFonts.android.ts b/src/alf/util/unusedUseFonts.android.ts
new file mode 100644
index 000000000..083c9d4d6
--- /dev/null
+++ b/src/alf/util/unusedUseFonts.android.ts
@@ -0,0 +1,19 @@
+import {useFonts} from 'expo-font'
+
+/*
+ * IMPORTANT: This is unused. Expo statically extracts these fonts.
+ *
+ * All used fonts MUST be configured here. Unused fonts can be commented out.
+ *
+ * This is used for both web fonts and native fonts.
+ */
+export function DO_NOT_USE() {
+  return useFonts({
+    'Inter-Regular': require('../../../assets/fonts/inter/Inter-Regular.otf'),
+    'Inter-Italic': require('../../../assets/fonts/inter/Inter-Italic.otf'),
+    'Inter-Bold': require('../../../assets/fonts/inter/Inter-SemiBold.otf'),
+    'Inter-BoldItalic': require('../../../assets/fonts/inter/Inter-SemiBoldItalic.otf'),
+    'Inter-Black': require('../../../assets/fonts/inter/Inter-ExtraBold.otf'),
+    'Inter-BlackItalic': require('../../../assets/fonts/inter/Inter-ExtraBoldItalic.otf'),
+  })
+}
diff --git a/src/alf/util/unusedUseFonts.ts b/src/alf/util/unusedUseFonts.ts
new file mode 100644
index 000000000..70bdc285b
--- /dev/null
+++ b/src/alf/util/unusedUseFonts.ts
@@ -0,0 +1,15 @@
+import {useFonts} from 'expo-font'
+
+/*
+ * IMPORTANT: This is unused. Expo statically extracts these fonts.
+ *
+ * All used fonts MUST be configured here. Unused fonts can be commented out.
+ *
+ * This is used for both web fonts and native fonts.
+ */
+export function DO_NOT_USE() {
+  return useFonts({
+    InterVariable: require('../../../assets/fonts/inter/InterVariable.ttf'),
+    'InterVariable-Italic': require('../../../assets/fonts/inter/InterVariable-Italic.ttf'),
+  })
+}