Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/src/main/java/me/bmax/apatch/ui/theme/FontConfig.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.bmax.apatch.ui.theme

import android.content.Context
import android.os.Build
import android.graphics.Typeface
import android.net.Uri
import android.util.Log
Expand Down Expand Up @@ -133,6 +134,13 @@ object FontConfig {
private var cachedFilename: String? = null

fun getFontFamily(context: Context): FontFamily {
// Android 15 devices have reported crashes in the EmojiCompat/text layout pipeline
// when a user-supplied global font is active. Fall back to the system font there.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
cachedFilename = null
cachedFontFamily = null
return FontFamily.Default
}
if (isCustomFontEnabled && customFontFilename != null) {
// Return cached font if filename hasn't changed
if (customFontFilename == cachedFilename && cachedFontFamily != null) {
Expand Down
Loading
Loading