TableListBox and Japanese Text

I have a tablelistbox that’s displaying both English and Japanese text.

Using Font(L"Lucida Grande") I get this…

using Font(L"Hiragino Kaku Gothic Pro W6") I get the correct Glyphs.

I’ve done a bit of digging into and thanks to g00gle
ATSUSetTransientFontMatching (layout, true); makes it seem like it should lookup the glyphs automatically… but obviously something is failing.

Any ideas? Or hypothesis?

Here’s some Japanese text if it helps (for copy/paste into a string literal)

…no, can’t think of any reason it’d do that - like you say, it’s supposed to automatically substitute a font for the missing glyphs. I’ll take a look soon, but can’t think of any suggestions at the moment.

I had this same problem on windows with Chinese testers. They could not input text or render the text properly before the font was changed to a Chinese one.

Also wrong thread but it reminded me (hope you don’t mind justin =))…If it’s not on your list already, an option to change the color of TableListBoxHeader would be superb.

Its reproducible with the JUCE Font demo if it helps…

I can reproduce it but am a bit stumped about what I could do to fix it - I already do the stuff that you’re supposed to do to enable font substitution. Can’t see anything else I could use that might have an effect.

I hear ya! My hypothesis is it requires a run of characters to figure out what font would be a good substitute and is too dumb to analyze a single character. (Or perhaps only the ATSUI drawText function provides this capability?)

There is an option to provide fallback fonts, I might play with that a little… I know the OS is doing something because when it hits the Japanese characters in the tablelistbox it slows down slightly when I scroll(NSTableView does the same thing while it analyzes the characters)

I’ll let you know if I find out anything, in the interim i’ll just specify a japanese font!

That’s a really good suggestion, though it takes unicode characters, so should be unambiguous when it gets a japanese one… I’m deep in the cocoa rewrite at the moment, but will check this out when I get as far as the font handling code…

Hello, has there been any progress on this?


I am encountering the same thing now

For example, DBG on a Japanese String gives me ピーター・ブレイナー&ヒズ・チェンバー・オーケストラ

While drawText is giving me wingdings and arabic script 


What should I do about this? 

This original thread was from 2008, so all the font code has changed since then!

I think you probably just need to draw it with a font that actually contains japanese characters.