The best way to control Claude Code, Codex and more from any computer or phone
fix(mobile): Android composer renders DM Sans (#30230)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Nov 6, 2026 at 18:51 UTC
23bdb9ef1cc39ddb21a3e077f97f580d50b8fc22
3 files changed
+19
-3
apps/mobile/modules/t3-composer-editor/android/build.gradle
+1
@@ -20,6 +20,7 @@ android {
20
21
dependencies {
22
implementation project(':expo-modules-core')
23
+ implementation 'com.facebook.react:react-android'
24
testImplementation 'junit:junit:4.13.2'
25
testImplementation 'org.robolectric:robolectric:4.16.1'
26
}
apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt
+3
-1
@@ -30,6 +30,7 @@ import android.view.inputmethod.InputConnection
30
import android.view.inputmethod.InputConnectionWrapper
31
import android.view.inputmethod.InputMethodManager
32
import android.widget.EditText
33
+import com.facebook.react.common.assets.ReactFontManager
34
import expo.modules.kotlin.AppContext
35
import expo.modules.kotlin.viewevent.EventDispatcher
36
import expo.modules.kotlin.views.ExpoView
@@ -276,8 +277,9 @@ class T3ComposerEditorView(context: Context, appContext: AppContext) : ExpoView(
277
editor.typeface = if (fontFamily.contains("Mono", ignoreCase = true)) {
278
Typeface.MONOSPACE
279
} else {
279
- Typeface.DEFAULT
280
+ ReactFontManager.getInstance().getTypeface(fontFamily, Typeface.NORMAL, context.assets)
281
}
282
+ applyLineHeight()
283
editor.applyPlaceholder()
284
}
285
apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ContextChip.kt
+15
-2
@@ -9,6 +9,7 @@ import android.graphics.RectF
9
import android.graphics.Typeface
10
import android.text.TextPaint
11
import android.text.TextUtils
12
+import com.facebook.react.common.assets.ReactFontManager
13
import kotlin.math.ceil
14
import kotlin.math.min
15
@@ -29,14 +30,14 @@ class T3ContextChip(
30
31
private val paint = TextPaint(Paint.ANTI_ALIAS_FLAG).apply {
32
textSize = fontSize
32
- typeface = Typeface.create("sans-serif-medium", Typeface.NORMAL)
33
+ typeface = chipTypeface()
34
color = this@T3ContextChip.color
35
}
36
private val em = fontSize
37
38
private val detailPaint = TextPaint(Paint.ANTI_ALIAS_FLAG).apply {
39
textSize = fontSize * 0.84f
39
- typeface = Typeface.create("sans-serif-medium", Typeface.NORMAL)
40
+ typeface = chipTypeface()
41
color = this@T3ContextChip.color
42
}
43
private val detailText = if (content.detail.isEmpty()) "" else " ${content.detail}"
@@ -86,6 +87,18 @@ class T3ContextChip(
87
}
88
89
companion object {
90
+ private const val CHIP_FONT_FAMILY = "DMSans-Medium"
91
+
92
+ // Matches the iOS chips; builds without the bundled font keep the platform medium.
93
+ private fun chipTypeface(): Typeface {
94
+ val fonts = ReactFontManager.getInstance()
95
+ return if (CHIP_FONT_FAMILY in fonts.customFontFamilies) {
96
+ fonts.getTypeface(CHIP_FONT_FAMILY, Typeface.NORMAL, null)
97
+ } else {
98
+ Typeface.create("sans-serif-medium", Typeface.NORMAL)
99
+ }
100
+ }
101
+
102
fun color(
103
value: String,
104
fallback: Int