Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hey! 

Can dig into this later, but I remember that the Arabic support script did something like this to get ligatures working.

My RTL support script: https://pastebin.com/h9fyzJcq

Arabic support for Unity by Konash: https://github.com/Konash/arabic-support-unity

STM Emoji Support: https://pastebin.com/qr9me3GA


Essentially, the Unity inspector and other aspects just fail when it comes to ligatures, languages with connected scripts, rendering RTL text, and emoji. 

I think if you go through the source code for Konash's Arabic support script and my Emoji support script, you'll be able to find a way to take the original string, and send that in a way that renders correctly. But it would have to skip anything related to Unity's inspector, so... a replacement script like what you wrote or something that fixes these problems on the fly is probably the way to go. Check out STM's "PreParse" event too, that method is meant for doing things like this, taking text sent to STM, and modifying it before it's actually processed by STM. (My Emoji script shows how to do this) That will let you just have this as a component you can put on any STM object you want to have ligature support. (Or any other custom processing code you can imagine)

All great suggestions, thank you! I explored the built in PreParse event, and it probab;y would have been where I put this stuff if I had been using STM from the get go in my development. As it stands, I have a significant amount of code devoted to building/validating/massaging text before it gets to STM, and it makes the most sense for it to go there.

I checked out Konash's solution, and at the end of the day, it's very similar to mine. It maps directly to the glyphs of final ligature forms. The big difference is that everything is hard coded in their solution, while I'll be needing different ligature sets/mappings for each different language in my game.

I DO think it would be possible to make a truly generalized solution to this, but that would be a project unto itself.  Ultimately it would look very similar to either my code or Konash's, but it would build its mapping tables by opening and consuming the OTF files directly.

Ultimately I am just flabbergasted that Unity has not implemented this and has no plans to. Ligatures are... just fundamental.