Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7861642
load font using useFont
Rohit3523 Feb 20, 2026
bb93bbd
suggested by code rabbit
Rohit3523 Feb 20, 2026
4e36d8b
log font error
Rohit3523 Feb 20, 2026
c654eab
Merge branch 'develop' into load-custom-font
julio-rocketchat Mar 11, 2026
c46ac98
Added package
Rohit3523 Mar 18, 2026
e9fa212
move fontLoad error inside useEffect
Rohit3523 Mar 18, 2026
4a2a58a
chore: format code and fix lint issues
Rohit3523 Mar 18, 2026
81843fa
Merge branch 'develop' into load-custom-font
Rohit3523 Mar 18, 2026
c36c4f2
chore: format code and fix lint issues
Rohit3523 Mar 18, 2026
1329729
Merge branch 'develop' into load-custom-font
Rohit3523 Apr 7, 2026
f30a6cc
expo-font patch
Rohit3523 Apr 13, 2026
fdcf3dc
revert changes
Rohit3523 Apr 13, 2026
9f73acc
more cleanup
Rohit3523 Apr 13, 2026
e1e7557
Merge branch 'develop' into load-custom-font
Rohit3523 Apr 13, 2026
73d355b
expo-asset
Rohit3523 Apr 13, 2026
c57ff89
patch fix
Rohit3523 Apr 13, 2026
3b4fef4
Merge branch 'load-custom-font' of https://github.com/RocketChat/Rock…
Rohit3523 Apr 13, 2026
f5d3d06
patch update
Rohit3523 Apr 14, 2026
6b5a5bb
Merge branch 'develop' into load-custom-font
Rohit3523 Apr 14, 2026
005fd57
using ReactContextLost instead of AppContextLost
Rohit3523 Apr 15, 2026
eca8c0d
comment update
Rohit3523 Apr 15, 2026
6b35d34
Merge branch 'develop' into load-custom-font
Rohit3523 Apr 15, 2026
4b7df87
rerun ci
Rohit3523 Apr 15, 2026
bc6dc98
revert
Rohit3523 Apr 15, 2026
bc5134e
Merge branch 'load-custom-font' of https://github.com/RocketChat/Rock…
Rohit3523 Apr 15, 2026
330a68b
Limit patch for android 8 and less only
Rohit3523 Apr 15, 2026
1dd2522
patch fix...
Rohit3523 Apr 15, 2026
8f00c97
rerun fresh CI
Rohit3523 Apr 15, 2026
b0450c4
revert
Rohit3523 Apr 15, 2026
243db90
force refresh
Rohit3523 Apr 17, 2026
2ceef55
Merge branch 'develop' into load-custom-font
Rohit3523 Apr 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-preset-expo": "~54.0.9",
"eslint": "^8.57.0",
"eslint-config-prettier": "~10.1.8",
"eslint-config-prettier": "10.1.8",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it really necessary? if it's not please just rollback it and you can merge.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is done to refresh the CI cache to make sure that patch is being applied

"eslint-import-resolver-typescript": "~4.4.4",
"eslint-plugin-import": "~2.32.0",
"eslint-plugin-jest": "~29.14.0",
Expand Down
26 changes: 26 additions & 0 deletions patches/expo-asset+12.0.12.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/node_modules/expo-asset/android/src/main/java/expo/modules/asset/AssetModule.kt b/node_modules/expo-asset/android/src/main/java/expo/modules/asset/AssetModule.kt
index 9f1e2c6..d4c49cd 100644
--- a/node_modules/expo-asset/android/src/main/java/expo/modules/asset/AssetModule.kt
+++ b/node_modules/expo-asset/android/src/main/java/expo/modules/asset/AssetModule.kt
@@ -3,6 +3,7 @@ package expo.modules.asset
import android.content.Context
import android.net.Uri
import android.util.Log
+import android.os.Build
import expo.modules.interfaces.filesystem.Permission
import expo.modules.kotlin.AppContext
import expo.modules.kotlin.exception.CodedException
@@ -80,6 +81,13 @@ class AssetModule : Module() {
Name("ExpoAsset")

AsyncFunction("downloadAsync") Coroutine { uri: URI, md5Hash: String?, type: String ->
+ // If the scheme is null, it's a raw asset (e.g., "custom.ttf").
+ // Returning early prevents Expo from trying to "cache" a local native file.
+ // Only for Android 8 and early
+ if (uri.scheme == null && Build.VERSION.SDK_INT <= Build.VERSION_CODES.O) {
+ return@Coroutine uri
+ }
+
if (uri.scheme == "file" && !uri.toString().startsWith(ANDROID_EMBEDDED_URL_BASE_RESOURCE)) {
return@Coroutine uri
}
38 changes: 38 additions & 0 deletions patches/expo-font+14.0.10.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/node_modules/expo-font/android/src/main/java/expo/modules/font/FontLoaderModule.kt b/node_modules/expo-font/android/src/main/java/expo/modules/font/FontLoaderModule.kt
index 2cd51dc..db368ff 100644
--- a/node_modules/expo-font/android/src/main/java/expo/modules/font/FontLoaderModule.kt
+++ b/node_modules/expo-font/android/src/main/java/expo/modules/font/FontLoaderModule.kt
@@ -5,6 +5,7 @@ package expo.modules.font
import android.content.Context
import android.graphics.Typeface
import android.net.Uri
+import android.os.Build
import com.facebook.react.common.assets.ReactFontManager
import expo.modules.kotlin.exception.CodedException
import expo.modules.kotlin.exception.Exceptions
@@ -34,6 +35,25 @@ open class FontLoaderModule : Module() {
AsyncFunction("loadAsync") { fontFamilyName: String, localUri: String ->
val context = appContext.reactContext ?: throw Exceptions.ReactContextLost()

+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.O) {
+ // Only run this if it's a raw asset name (no protocol, not absolute)
+ if (!localUri.contains(":") && !localUri.startsWith("/")) {
+ val assetCandidates = listOf(
+ if (localUri.startsWith("fonts/")) localUri else "fonts/$localUri",
+ localUri.removePrefix("fonts/")
+ ).distinct()
+
+ for (candidate in assetCandidates) {
+ val typeface = runCatching { Typeface.createFromAsset(context.assets, candidate) }.getOrNull()
+ if (typeface != null) {
+ ReactFontManager.getInstance().setTypeface(fontFamilyName, Typeface.NORMAL, typeface)
+ loadedFonts = loadedFonts.toMutableSet().apply { add(fontFamilyName) }.toList()
+ return@AsyncFunction // Exit early if we successfully loaded the font
+ }
+ }
+ }
+ }
+
// TODO(nikki): make sure path is in experience's scope
val typeface: Typeface = if (localUri.startsWith(ASSET_SCHEME)) {
Typeface.createFromAsset(
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7105,16 +7105,16 @@ escodegen@^2.0.0:
optionalDependencies:
source-map "~0.6.1"

eslint-config-prettier@10.1.8:
version "10.1.8"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz#15734ce4af8c2778cc32f0b01b37b0b5cd1ecb97"
integrity sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==

eslint-config-prettier@^8.5.0:
version "8.10.2"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.10.2.tgz#0642e53625ebc62c31c24726b0f050df6bd97a2e"
integrity sha512-/IGJ6+Dka158JnP5n5YFMOszjDWrXggGz1LaK/guZq9vZTmniaKlHcsscvkAhn9y4U+BU3JuUdYvtAMcv30y4A==

eslint-config-prettier@~10.1.8:
version "10.1.8"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz#15734ce4af8c2778cc32f0b01b37b0b5cd1ecb97"
integrity sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==

eslint-import-context@^0.1.8:
version "0.1.9"
resolved "https://registry.yarnpkg.com/eslint-import-context/-/eslint-import-context-0.1.9.tgz#967b0b2f0a90ef4b689125e088f790f0b7756dbe"
Expand Down
Loading