Snowmtl: Change default font family (#6822)

* Change default font family

* Fix filename
This commit is contained in:
Chopper 2024-12-27 03:09:52 -03:00 committed by Draff
parent 4e1beae2b7
commit 68ccc79b5b
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
5 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Snow Machine Translations'
extClass = '.SnowmltFactory'
extVersionCode = 4
extClass = '.SnowmtlFactory'
extVersionCode = 5
isNsfw = true
}

View File

@ -35,7 +35,7 @@ data class Dialog(
val angle: Float = 0f,
val isBold: Boolean = false,
val isNewApi: Boolean = false,
val type: String = "sub",
val type: String = "normal",
private val fbColor: List<Int> = emptyList(),
private val bgColor: List<Int> = emptyList(),
) {

View File

@ -6,7 +6,7 @@ import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
@RequiresApi(Build.VERSION_CODES.O)
class SnowmltFactory : SourceFactory {
class SnowmtlFactory : SourceFactory {
override fun createSources(): List<Source> = languageList.map(::Snowmtl)
}

View File

@ -125,12 +125,13 @@ class ComposedImageInterceptor(
}
private fun loadAllFont(chain: Interceptor.Chain) {
val fallback = loadFont("coming_soon_regular.ttf")
fontFamily.keys.forEach { key ->
val font = fontFamily[key] ?: return@forEach
if (font.second != null) {
return@forEach
}
fontFamily[key] = key to (loadRemoteFont(font.first, chain) ?: loadFont("coming_soon_regular.ttf"))
fontFamily[key] = key to (loadRemoteFont(font.first, chain) ?: fallback)
}
}