mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-14 01:48:04 -04:00
silently ignore font loading errors (if not default)
They are not yet present in 1.14
This commit is contained in:
parent
f5ae8978b9
commit
17f7c96a2b
@ -52,11 +52,7 @@ class FontManager(default: FontType? = null) {
|
|||||||
fonts[name]?.let { return it }
|
fonts[name]?.let { return it }
|
||||||
|
|
||||||
|
|
||||||
val font = FontLoader.load(context, this, index, latch)
|
val font = FontLoader.load(context, this, index, latch) ?: return null
|
||||||
if (font == null) {
|
|
||||||
Log.log(LogMessageType.ASSETS, LogLevels.WARN) { "Font $index seems to be empty!" }
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
val type = font.trim() ?: return null
|
val type = font.trim() ?: return null
|
||||||
|
|
||||||
this.fonts[name] = type
|
this.fonts[name] = type
|
||||||
@ -68,8 +64,12 @@ class FontManager(default: FontType? = null) {
|
|||||||
fun create(context: RenderContext, latch: AbstractLatch): FontManager {
|
fun create(context: RenderContext, latch: AbstractLatch): FontManager {
|
||||||
val manager = FontManager()
|
val manager = FontManager()
|
||||||
|
|
||||||
val default = manager.load(DefaultFontIndices.DEFAULT, context, latch) ?: EmptyFont
|
val default = manager.load(DefaultFontIndices.DEFAULT, context, latch)
|
||||||
manager::default.forceSet(default)
|
if (default == null) {
|
||||||
|
Log.log(LogMessageType.ASSETS, LogLevels.WARN) { "Default font is empty!" }
|
||||||
|
}
|
||||||
|
|
||||||
|
manager::default.forceSet(default ?: EmptyFont)
|
||||||
|
|
||||||
for (index in DefaultFontIndices.ALL) {
|
for (index in DefaultFontIndices.ALL) {
|
||||||
manager.load(index, context, latch)
|
manager.load(index, context, latch)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user