Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm currently trying to get text layout working in a game and the /only/ text control provided by the engine is one that "can" be editable, since it's assumed for non-editable text you'd just use graphics. However, this game has a lot of dialogue and must be translated into multiple languages so that's not a realistic option.

It's a fucking nightmare. It turns out it uses Cairo internally so that's not bad, but I /need/ to know where the last glyph is and answering questions about how your text actually is going to be laid out in the end is next to impossible everywhere I look.

Since, again, this has to work in multiple languages including CJK I am loathe to code my own text control but I may have to.



Have you looked into harfbuzz? afaik it's designed to solve that problem, for all languages.

https://harfbuzz.github.io/


I'll keep it in mind, but right now I'm trying to only use the classes that are provided by the engine or my own code as much as possible, since adding a dependency becomes a whole /thing/ in cross-platform game engines sometimes.


Not sure if your game has any spatial 3D consideration but this project uses real time Multi-channel signed distance field generation :

[1] https://github.com/Chlumsky/msdfgen


Check out slug if you haven't already: https://sluglibrary.com/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: