Skip to content

Commit

Permalink
fix(font settings): Prevent showing multiple fonts of the same family…
Browse files Browse the repository at this point in the history
… name
  • Loading branch information
jmir1 committed Nov 2, 2023
1 parent 5567be6 commit 802b3ac
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ private fun SubtitleFont(
).listFiles { file ->
file.extension.equals("ttf", true) ||
file.extension.equals("otf", true)
}?.map {
}?.associate {
TTFFile.open(it).families.values.toTypedArray()[0] to it.absolutePath
} ?: emptyList()
listOf("Sans Serif" to "") + customFonts
} ?: emptyMap()
mapOf("Sans Serif" to ("" to null)) + customFonts
}
}
var selectingFont by remember { mutableStateOf(false) }
Expand Down Expand Up @@ -152,7 +152,7 @@ private fun SubtitleFont(

DropdownMenu(expanded = selectingFont, onDismissRequest = { selectingFont = false }) {
fontList.map {
val fontName = it.first
val fontName = it.key + (it.value.second?.let { type -> " ($type)" } ?: "")
DropdownMenuItem(
text = { Text(fontName) },
onClick = { updateFont(fontName) },
Expand Down

0 comments on commit 802b3ac

Please sign in to comment.