From deb70f44ce752056debbb7ef778309eeca794e7f Mon Sep 17 00:00:00 2001 From: Dan Fabulich Date: Mon, 25 May 2026 10:52:45 -0700 Subject: [PATCH] Use `ResourcesCompat.getFont()` for backwards compatibility with API 24 --- Sources/SkipUI/SkipUI/Text/Font.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/SkipUI/SkipUI/Text/Font.swift b/Sources/SkipUI/SkipUI/Text/Font.swift index ba5d296b..bcaa19af 100644 --- a/Sources/SkipUI/SkipUI/Text/Font.swift +++ b/Sources/SkipUI/SkipUI/Text/Font.swift @@ -3,6 +3,7 @@ #if !SKIP_BRIDGE #if SKIP import android.graphics.Typeface +import androidx.core.content.res.ResourcesCompat import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.platform.LocalContext @@ -212,7 +213,7 @@ public struct Font : Hashable { } else { android.util.Log.w("SkipUI", "unable to find font named: \(fontName) (\(name))") } - } else if let customTypeface = ctx.resources.getFont(fid) { + } else if let customTypeface = ResourcesCompat.getFont(ctx, fid) { fontFamily = FontFamily(customTypeface) } else { android.util.Log.w("SkipUI", "unable to find font named: \(name)")