Entering/displaying Hindi (Devanagari) font

Hi,

I apologize in advance if this has been properly explained elsewhere, but I couldn’t really find the complete solution in the various posts. I’m trying to allow the entering (in TextEditor) and displaying of text in Hindi font. I could use a specific freeware Indian font for that, but I thought that now that Unicode supports Indian fonts and it’s available by default on both Mac and Windows I should rather go for that option.

So I activated the Asian languages options on my XP machine and lo and behold I was able to type Hindi script on Notepad, VC++, etc… by just selecting the Hindi keyboard in the Language bar. However, when I type any text in a Juce label (TextEditor), nothing happens. The cursor shakes, but stays at the same place, like the character is not accepted.

Could you please let me know what I need to do? I saw some posts about defining a specific default font for that component, but I wouldn’t know which one to specify. This is all quite magical to me, because when I type text in the Notepad, the selected font is Lucida, yet it displays Hindi script, so I don’t know whether the Lucida font has been expanded with Indian characters, or it’s a separate font that is used in the background.

Thanks for your help!

Mariano

Unfortunately, it is currently not possible to input or edit Hindi (or any other Complex Text language) in Juce. The Juce TextEditor (and all other text input controls) only support editing text in “Simple” languages.

It is possible to display Hindi (and any other Complex Text language) using the AttributedString and TextLayout classes. This only works on Vista (with Platform Update) and later versions of Windows, Mac OS X 10.5+ and iOS 3.2+. It is very unlikely you will ever see support for Complex Text on Windows XP in Juce.

Oh, I see… Thanks a lot for the info. I’ll go back to the initial idea of using a custom font, because I definitely need it to work on XP as well. It will also help me avoid the problem of glyphs combining.

What is considered a Complex text language? I see Chinese and Japanese scripts work.

Chinese, Japanese and Korean are all “Simple” languages.
Examples of Complex Text Languages: Hebrew, Arabic, Hindi, Urdu, Thai, Most Indic Languages

Thanks. I understand the problem now.

I have found a solution using a specific font. The problem was finding one that had the same mapping on Mac and Windows. Only problem is that users will have to install that, instead of using the inbuilt Unicode fonts.

Reviving this, what’s the best way to do this in JUCE 7?
Does JUCE 8 Unicode support completely solve this problem?

We’re aiming to solve this in JUCE 8. Hindi text should already display correctly in labels in JUCE 8. We’re still working on improvements to the TextEditor to allow editing of text using CTLs.

1 Like

On JUCE 7, it works perfectly on browser component + captions. On Windows, it works on browser, but not on captions.

From what I have seen, JUCE 8 does a better job on Windows captions, though there are still some glitches. But if you use web views, then you shouldn’t face any problem.

Are you able to share any examples of glitches or text that doesn’t display the way you’d expect? Those would be useful test-cases.

By “captions”, are you referring to JUCE labels, or to something else?

Yes, labels.

For glitches, I think it’s mainly the spacing that’s off. Check the example below against the original text following. You’ll see from the very beginning the JUCE label concatenates various words.

091d81ef6b3f42e75bcc23e78c97045244d658f7_2_690x203

इस अनुभाग की रचना हिंदुस्तानी संगीत अथवा उत्तर भारतीय शास्त्रीय संगीत परंपरा का आधारभूत ज्ञान प्रदान करने के लिए की गई है। इस भाग में राग, ताल, स्वर आदि से संबन्धित अवधारणाओं और साथ ही साथ इस कला से संबन्धित विभिन्न पहलुओं से आपका परिचय करवाया जाएगा। संगीत शिक्षण के दौरान आपकी सहायता के लिए अनेक एनिमेशन, ध्वनि क्लिप एवं प्रस्तुतियों का समावेश किया गया है।