Skip to content

Commit bea1c6c

Browse files
committed
Fixed ttf loading in prod
1 parent da573ce commit bea1c6c

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/main/kotlin/com/lambda/gui/DearImGui.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import com.lambda.event.EventFlow.post
2323
import com.lambda.event.events.GuiEvent
2424
import com.lambda.module.modules.client.ClickGui
2525
import com.lambda.module.modules.client.GuiSettings
26-
import com.lambda.util.path
26+
import com.lambda.util.stream
2727
import com.mojang.blaze3d.opengl.GlStateManager
2828
import com.mojang.blaze3d.systems.RenderSystem
2929
import imgui.ImFontConfig
@@ -67,8 +67,8 @@ object DearImGui : Loadable {
6767
val size = BASE_FONT_SCALE * scale
6868
with(io.fonts) {
6969
clear()
70-
addFontFromFileTTF("fonts/FiraSans-Regular.ttf".path, size, fontConfig, glyphRanges)
71-
addFontFromFileTTF("fonts/MinecraftDefault-Regular.ttf".path, size, fontConfig, glyphRanges)
70+
addFontFromMemoryTTF("fonts/FiraSans-Regular.ttf".stream.readAllBytes(), size, fontConfig, glyphRanges)
71+
addFontFromMemoryTTF("fonts/MinecraftDefault-Regular.ttf".stream.readAllBytes(), size, fontConfig, glyphRanges)
7272
build()
7373
}
7474
implGl3.createFontsTexture()

src/main/kotlin/com/lambda/util/LambdaResource.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,4 @@ val LambdaResource.url: URL
3535
get() = Lambda::class.java.getResource("/assets/lambda/$this")
3636
?: throw FileNotFoundException("File \"/assets/lambda/$this\" not found")
3737

38-
val LambdaResource.path: String
39-
get() = Paths.get(url.toURI()).toString()
40-
4138
fun LambdaResource.readImage(): BufferedImage = ImageIO.read(this.stream)

0 commit comments

Comments
 (0)