expo-font 12.0.9 → 12.0.10

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.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 12.0.10 — 2024-09-03
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fix support for macOS. ([#31307](https://github.com/expo/expo/pull/31307) by [@gabrieldonadel](https://github.com/gabrieldonadel))
18
+
13
19
  ## 12.0.9 — 2024-07-16
14
20
 
15
21
  ### 🐛 Bug fixes
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'host.exp.exponent'
4
- version = '12.0.9'
4
+ version = '12.0.10'
5
5
 
6
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
7
  apply from: expoModulesCorePlugin
@@ -14,6 +14,6 @@ android {
14
14
  namespace "expo.modules.font"
15
15
  defaultConfig {
16
16
  versionCode 29
17
- versionName "12.0.9"
17
+ versionName "12.0.10"
18
18
  }
19
19
  }
@@ -47,6 +47,7 @@ private func maybeSwizzleUIFont() {
47
47
  if hasSwizzled {
48
48
  return
49
49
  }
50
+ #if !os(macOS)
50
51
  let originalFontNamesMethod = class_getClassMethod(UIFont.self, #selector(UIFont.fontNames(forFamilyName:)))
51
52
  let newFontNamesMethod = class_getClassMethod(UIFont.self, #selector(UIFont._expo_fontNames(forFamilyName:)))
52
53
 
@@ -55,5 +56,6 @@ private func maybeSwizzleUIFont() {
55
56
  } else {
56
57
  log.error("expo-font is unable to swizzle `UIFont.fontNames(forFamilyName:)`")
57
58
  }
59
+ #endif
58
60
  hasSwizzled = true
59
61
  }
@@ -25,7 +25,11 @@ internal func queryCustomNativeFonts() -> [String] {
25
25
  // [2] Retrieve font names by family names
26
26
  return fontFamilies.flatMap { fontFamilyNames in
27
27
  return fontFamilyNames.flatMap { fontFamilyName in
28
+ #if os(iOS) || os(tvOS)
28
29
  return UIFont.fontNames(forFamilyName: fontFamilyName)
30
+ #elseif os(macOS)
31
+ return NSFontManager.shared.availableMembers(ofFontFamily: fontFamilyName)?.compactMap { $0[0] as? String } ?? []
32
+ #endif
29
33
  }
30
34
  }
31
35
  }
@@ -1,3 +1,4 @@
1
+ #if !os(macOS)
1
2
  /**
2
3
  An extension to ``UIFont`` that adds a custom implementation of `fontNames(forFamilyName:)` that supports aliasing font families.
3
4
  */
@@ -25,3 +26,4 @@ public extension UIFont {
25
26
  return fontNames
26
27
  }
27
28
  }
29
+ #endif
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-font",
3
- "version": "12.0.9",
3
+ "version": "12.0.10",
4
4
  "description": "Load fonts at runtime and use them in React Native components.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -42,5 +42,5 @@
42
42
  "peerDependencies": {
43
43
  "expo": "*"
44
44
  },
45
- "gitHead": "b62618a8f99582621e1252c7a8013c62e1c6e013"
45
+ "gitHead": "de377512cb1707aee70e78cc8fd875d2ba9c3ab4"
46
46
  }