jtransc / gdx-backend-jtransc

GDX backend for JTransc: targeting every platform lime supports (html5, windows, linux, mac, android, ios...) (flash is wip) (consoles + unity likely to be supported in the future)
23 stars 6 forks source link

FreeType supported? #62

Closed ghost closed 7 years ago

ghost commented 7 years ago

I see this https://github.com/jtransc/java-freetype but last activity year ago. This works?

If i try enable on my libgdx project i get error Error : com.badlogic.gdx.graphics.g2d.freetype.FreeType.initFreeTypeJni :: ()J: No method body

soywiz commented 7 years ago

Tried to get it working, but was a bit tricky. I ended using bitmap fonts instead. But If you really need it I can try again

ghost commented 7 years ago

Yes, my game use it, but maybe i can replace to bitmap use distance font. We use generating for no scale, because T L I and other may corrupted if scale bitmap.

soywiz commented 7 years ago

So I suspect you cannot use near-neighborhood for distance font? Or somehow mipmaps. Not sure about the implementation. But your best bet right now is to use bitmap fonts; maybe creating the font for several sizes.

Or maybe we can try to use something like this (Haxe-specific): http://docs.openfl.org/lime/graphics/Font.html Right now the other supported target is pure-JS.

But don't remember the public API. If it is too complex, it would be hard to adapt. But if the API is simple. We can use lime/graphic/Font + I can implement html canvas. I wanted to use java-freetype so it is really portable and works on all targets out of the box with possible optimizations for targets supporting this directly.