react-native-controlled-input 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,12 +87,12 @@ fun JetpackComposeView(
87
87
  val fontSize = style?.fontSize?.let { it.sp } ?: 24.sp
88
88
  val fontFamily = remember(style?.fontFamily) {
89
89
  style?.fontFamily?.let { name ->
90
- listOf("ttf", "otf").firstNotNullOfOrNull { ext ->
91
- try {
92
- FontFamily(Typeface.createFromAsset(context.assets, "fonts/$name.$ext"))
93
- } catch (_: Exception) {
94
- null
95
- }
90
+ try {
91
+ val typeface = com.facebook.react.views.text.ReactFontManager.getInstance()
92
+ .getTypeface(name, Typeface.NORMAL, context.assets)
93
+ typeface?.let { FontFamily(it) }
94
+ } catch (_: Exception) {
95
+ null
96
96
  }
97
97
  }
98
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-controlled-input",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "React Native Controlled Inputative Controlled Input",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",