libgdx icon indicating copy to clipboard operation
libgdx copied to clipboard

The future of the freetype extension?

Open mingmoe opened this issue 1 year ago • 3 comments

The LWJGL have added the bind of the freetype and the harfbuzz.(see https://github.com/LWJGL/lwjgl3/commit/9a00ff0af62aa0d0ddba04a88c1e5668d76699c8 and https://github.com/LWJGL/lwjgl3/commit/c84766565202ba41b71e23ca45a8e84a7d4cb971)

For freetype,the libgdx have a bind too.But libgdx doesn't have a bind for harfbuzz.

If someone update the LWJGL,the bind from libgdx is useless and meaningless.(It only provide some helper functions when use with libgdx.Other bind functions is replaced by LWJGL.)

And using freetype only can not shape font(the glyph that need shape inlcude right-to-left language or some emoji),the feature is from harfbuzz.

I think we should expand the freetype extenstion. Replace the bind code with LWJGL bind and add support for font shaping(using harfbuzz). I can provider a PR but it will take some time.

mingmoe avatar Jul 24 '23 10:07 mingmoe

Does this LWJGL HarfBuzz binding work on Android and iOS? Currently gdx-freetype works on those platforms, unless I'm mistaken, though it does not work on GWT unless you use a particular library. Having support for HarfBuzz, or complex scripts using some other library, would be great, though I'm unclear on how well it works with BitmapFont.

tommyettinger avatar Jul 24 '23 10:07 tommyettinger

Harfbuzz and freetype is the base of the font rendering in linux.And they does not need many platform features. So whether the bind work depends on LWJGL,not harfbuzz or freetype. LWJGL should work on Android and iOS. But I haven't test it.

For font shaping,it may need to modify BitmapFont or even add a new api set.

mingmoe avatar Jul 24 '23 10:07 mingmoe

I make the harfbuzz(rendered by freetype) work in java,using LWJGL-harfbuzz-and-freetype binding. But I still need to take some time to transfer it to libgdx.

image }7%I8QHS2LA4K{VT7 3Q1JO (Above are Fira Code ligature and Arabic,Chinese characters and emojis were also tested.)

By the way,is that better make this a third-party library?(Like the old freetype-extension)

mingmoe avatar Sep 09 '23 14:09 mingmoe