Closed NekoCaffeine closed 1 year ago
Hey,
I've started working on this and the first step was setting up CI builds for harfbuzz & freetype. They're up...
https://github.com/LWJGL-CI/harfbuzz/actions https://github.com/LWJGL-CI/freetype/actions
...but not without issues:
hb-ft.h
header) and freetype depends on harfbuzz (for improved auto-hinting). I wasted too much time on breaking this cycle and failed, so both features are disabled. I'm not sure how important this is (helper functions could be implemented manually? auto-hinting does not matter if harfbuzz is used directly?).I would really appreciate any contributions towards fixing the above (~especially the first one~). Contact me on the LWJGL discord server (https://discord.gg/yuKsaEguzj) if you need to discuss details.
Hey @Spasi I prepared CI/CD for compiling harfbuzz and freetype on all platforms, I hope that it'll help :)
LWJGL 3.2.2-snapshot+8
is now available with FreeType and HarfBuzz bindings.
-Dorg.lwjgl.harfbuzz.libname=freetype
Configuration.HARFBUZZ_LIBRARY_NAME.set("freetype")
Configuration.HARFBUZZ_LIBRARY_NAME.set(FreeType.getLibrary())
- recommendedorg.lwjgl.harfbuzz.natives-*
module is not required.Please report any issues with the FreeType/HarfBuzz interop. Also, any sample/demo contributions would be very welcome.
@Spasi Will this remain the default behaviour? Judging by the number of git updates seen in mkalinowski’s PR, it seems like you struggled a bit getting it all working together, so I’m unsure if you’re looking to change the current behaviour.
Please report any issues with the FreeType/HarfBuzz interop. Also, any sample/demo contributions would be very welcome.
As long as I can get it running, I’ll provide some samples/demos in the near time. :) I checked the website last night, after the latest updates to lwjgl-www. The nightly version was dated to 18.12.2022, but FreeType wasn’t on the list. I hope it’s there next time I try to download it.
@ws909 Indeed, it was a nightmare to get it working, especially making it have zero outside dependencies. I don't have a reason to change the above behavior, but I'm not going to use it either. If users think otherwise, please let me know.
One objective I have with the shared library loading mechanism in LWJGL is to allow advanced users replace LWJGL's native binaries with their own builds. There are a number of reasons they might want to do so. Right now, both FreeType and HarfBuzz bindings can be used independently and custom binaries will work. Only the "hacky" override described above is LWJGL specific, that's why it is optional by default.
I updated lwjgl3-www
this morning, you should be able to see FreeType now.
Hi, I'd like to request an freetype & harfbuzz binding.
Describe why you need it and how you're going to use it. I am trying to implement glyph rendering, but I realized that not all languages are as simple as common ones (just rendering from left to right). Some minor languages require the use of scripts in the font to calculate the layout.
Why harfbuzz and not ICU Layout engine. https://openjdk.java.net/projects/harfbuzz/ https://openjdk.java.net/jeps/258
Related Resources: https://www.freetype.org/developer.html#source-code https://harfbuzz.github.io/ https://harfbuzz.github.io/ch12.html
A simple shaping example: https://harfbuzz.github.io/ch03s03.html