And then the chinese char can shown correctly. So AttributedString has the capability of font fallback.
So, my question is what is the best way to show chinese in textbox with font-fallback, (do not want to set font which contain chinese char, just want to use font fallback the system provide ), bcz override the TextEditor’s paint is not a proper way to do it!
platform:windows
@ed95 is TextEditor supposed to support non-roman characters. Somewhat limiting if it doesn’t
With some fighting (our fault) we got TextLayout to display non-roman fallback characters correctly for our filenames on Windows. We are still trying on the Mac
Bump - still having this problem with the TextEditor…!
In other parts of the application, we were able to “enable” fallback fonts by replacing things like g.drawText(...) with AttributedStrings; (mostly those were our own custom components, so that was easy to do)
But what about TextEditor? Did anybody managed to make it work?
Is it something we can expect to be fixed at some point or shall we look at some ad-hoc fix for the time being?
Yes font fallback! +1000
I’ve asked for that for more than 10 years already, so i wouldn’t keep my hopes up if i were you.
You might want to consider using the Noto Sans font from Google. It looks decent, is free to use and embed, and has a broad set of supported characters right out of the box. Our UI has translation files for different languages, when a different language is chosen we pick a different flavour of the Noto font, so at least we can cover localisation that way. Sadly there isn’t one Font to rule them all, so a fallback would be still be very welcome.
I chatted to the team and @oli1 has been working on unicode support, obviously this is quite a big update and will take some time to make it out but as I understand it font fallback will work everywhere. I realise it’s been a long wait already but hopefully that offers a glimmer of hope for the future.