Snowmtl: Change default font family (#6822)
* Change default font family * Fix filename
This commit is contained in:
parent
4e1beae2b7
commit
68ccc79b5b
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'Snow Machine Translations'
|
extName = 'Snow Machine Translations'
|
||||||
extClass = '.SnowmltFactory'
|
extClass = '.SnowmtlFactory'
|
||||||
extVersionCode = 4
|
extVersionCode = 5
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ data class Dialog(
|
||||||
val angle: Float = 0f,
|
val angle: Float = 0f,
|
||||||
val isBold: Boolean = false,
|
val isBold: Boolean = false,
|
||||||
val isNewApi: Boolean = false,
|
val isNewApi: Boolean = false,
|
||||||
val type: String = "sub",
|
val type: String = "normal",
|
||||||
private val fbColor: List<Int> = emptyList(),
|
private val fbColor: List<Int> = emptyList(),
|
||||||
private val bgColor: List<Int> = emptyList(),
|
private val bgColor: List<Int> = emptyList(),
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import eu.kanade.tachiyomi.source.Source
|
||||||
import eu.kanade.tachiyomi.source.SourceFactory
|
import eu.kanade.tachiyomi.source.SourceFactory
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
class SnowmltFactory : SourceFactory {
|
class SnowmtlFactory : SourceFactory {
|
||||||
override fun createSources(): List<Source> = languageList.map(::Snowmtl)
|
override fun createSources(): List<Source> = languageList.map(::Snowmtl)
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,12 +125,13 @@ class ComposedImageInterceptor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun loadAllFont(chain: Interceptor.Chain) {
|
private fun loadAllFont(chain: Interceptor.Chain) {
|
||||||
|
val fallback = loadFont("coming_soon_regular.ttf")
|
||||||
fontFamily.keys.forEach { key ->
|
fontFamily.keys.forEach { key ->
|
||||||
val font = fontFamily[key] ?: return@forEach
|
val font = fontFamily[key] ?: return@forEach
|
||||||
if (font.second != null) {
|
if (font.second != null) {
|
||||||
return@forEach
|
return@forEach
|
||||||
}
|
}
|
||||||
fontFamily[key] = key to (loadRemoteFont(font.first, chain) ?: loadFont("coming_soon_regular.ttf"))
|
fontFamily[key] = key to (loadRemoteFont(font.first, chain) ?: fallback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue