xpenatan / gdx-teavm

Run Libgdx in a webbrowser with teavm
Apache License 2.0
107 stars 16 forks source link

freetype crashes #100

Closed SvenWollinger closed 8 months ago

SvenWollinger commented 1 year ago

Hello, from what i can tell im not missing anything from the example, outside of the fact that im using kotlin. Im getting this error message in my browser when FreeType is initialized: Ive used gdx-liftoff to generate my project and the teavm module has the neccessary extension to work with freetype. Im using my generator like this:

val params = FreeTypeFontGenerator.FreeTypeFontParameter().apply {
    this.size = size
    borderColor = com.badlogic.gdx.graphics.Color.BLACK
    borderWidth = 2F
}

val font: BitmapFont
FreeTypeFontGenerator(Gdx.files.internal("font.ttf")).apply {
    font = generateFont(params)
    dispose()
}

But i doubt that that is the issue, as it crashes even without the generator, when im manually calling FreeType.initFreeType(); Id be very thankfull if you could point me in the right direction here :)

dragbone commented 1 year ago

Hey @SvenWollinger, if you still have the same problem try updating to the latest version, that has fixed it for me (b4 -> b6)