mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Revert back to mpv-android's font
This commit is contained in:
parent
bbeb1c0488
commit
a6d5a0ba4c
4 changed files with 17 additions and 26 deletions
BIN
app/src/main/assets/subfont.ttf
Normal file
BIN
app/src/main/assets/subfont.ttf
Normal file
Binary file not shown.
|
|
@ -281,11 +281,11 @@ object SubtitleSettings {
|
|||
}
|
||||
}
|
||||
|
||||
if (fontBold) {
|
||||
MPVLib.setPropertyString("sub-font", "Roboto Bold")
|
||||
} else {
|
||||
MPVLib.setPropertyString("sub-font", "Roboto Regular")
|
||||
}
|
||||
// if (fontBold) {
|
||||
// MPVLib.setPropertyString("sub-font", "Roboto Bold")
|
||||
// } else {
|
||||
// MPVLib.setPropertyString("sub-font", "Roboto Regular")
|
||||
// }
|
||||
MPVLib.setPropertyBoolean("sub-bold", fontBold)
|
||||
MPVLib.setPropertyBoolean("sub-italic", fontItalic)
|
||||
|
||||
|
|
|
|||
|
|
@ -63,28 +63,20 @@ class AppUpgradeHandler
|
|||
|
||||
fun copySubfont(overwrite: Boolean) {
|
||||
try {
|
||||
listOf("Roboto-Regular", "Roboto-Bold")
|
||||
.forEach { font ->
|
||||
val fontFileName = "font-roboto/$font.ttf"
|
||||
val outputDir = File(context.filesDir, "fonts")
|
||||
if (!outputDir.exists()) {
|
||||
outputDir.mkdir()
|
||||
}
|
||||
val outputFile = File(outputDir, "$font.ttf")
|
||||
if (!outputFile.exists() || overwrite) {
|
||||
context.assets.open(fontFileName).use { input ->
|
||||
outputFile.outputStream().use { output ->
|
||||
input.copyTo(output)
|
||||
}
|
||||
}
|
||||
Timber.i("Wrote font %s to local", fontFileName)
|
||||
val fontFileName = "subfont.ttf"
|
||||
val outputFile = File(context.filesDir, fontFileName)
|
||||
if (!outputFile.exists() || overwrite) {
|
||||
context.assets.open(fontFileName).use { input ->
|
||||
outputFile.outputStream().use { output ->
|
||||
input.copyTo(output)
|
||||
}
|
||||
}
|
||||
val oldFont = File(context.filesDir, "subfont.ttf")
|
||||
if (oldFont.exists()) {
|
||||
Timber.w("Old subfont.tff exists, will delete it")
|
||||
oldFont.delete()
|
||||
Timber.i("Wrote font %s to local", fontFileName)
|
||||
}
|
||||
// val oldFontDir = File(context.filesDir, "fonts")
|
||||
// if (oldFontDir.exists()) {
|
||||
// oldFontDir.deleteRecursively()
|
||||
// }
|
||||
} catch (ex: Exception) {
|
||||
Timber.e(ex, "Exception copying subfont.tff")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ import com.github.damontecres.wholphin.util.mpv.MPVLib.MpvEvent.MPV_EVENT_FILE_L
|
|||
import com.github.damontecres.wholphin.util.mpv.MPVLib.MpvEvent.MPV_EVENT_PLAYBACK_RESTART
|
||||
import com.github.damontecres.wholphin.util.mpv.MPVLib.MpvEvent.MPV_EVENT_VIDEO_RECONFIG
|
||||
import timber.log.Timber
|
||||
import java.io.File
|
||||
import kotlin.concurrent.atomics.ExperimentalAtomicApi
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
|
|
@ -114,7 +113,7 @@ class MpvPlayer(
|
|||
|
||||
MPVLib.setOptionString("force-window", "no")
|
||||
MPVLib.setOptionString("idle", "yes")
|
||||
MPVLib.setOptionString("sub-fonts-dir", File(context.filesDir, "fonts").absolutePath)
|
||||
// MPVLib.setOptionString("sub-fonts-dir", File(context.filesDir, "fonts").absolutePath)
|
||||
|
||||
MPVLib.addObserver(this)
|
||||
MPVProperty.observedProperties.forEach(MPVLib::observeProperty)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue