react-native-controlled-input 0.14.0 → 0.15.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.
@@ -144,11 +144,23 @@ public class RNControlledInput: UIView, UITextFieldDelegate {
144
144
  }
145
145
 
146
146
  private func applyFont() {
147
- if let family = fontFamily, let font = UIFont(name: family, size: fontSize) {
148
- textField.font = font
149
- } else {
147
+ guard let family = fontFamily else {
150
148
  textField.font = UIFont.systemFont(ofSize: fontSize)
149
+ return
150
+ }
151
+ // UIFont(name:size:) needs the PostScript name. Expo's useFonts keys are aliased via a
152
+ // swizzled UIFont.fontNames(forFamilyName:) — RN Text resolves aliases that way, so we must too.
153
+ if let font = UIFont(name: family, size: fontSize) {
154
+ textField.font = font
155
+ return
156
+ }
157
+ for face in UIFont.fontNames(forFamilyName: family) {
158
+ if let font = UIFont(name: face, size: fontSize) {
159
+ textField.font = font
160
+ return
161
+ }
151
162
  }
163
+ textField.font = UIFont.systemFont(ofSize: fontSize)
152
164
  }
153
165
 
154
166
  private func applyAutoComplete() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-controlled-input",
3
- "version": "0.14.0",
3
+ "version": "0.15.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",