0

I have this small code which when run on android the text is rendered as boxes and not the actual content. In my device the bengali is not even rendered in the browsers. It shows boxes everywhere.

TextView tv = new TextView(this);
tv.setText("Hello, চন্দন");
setContentView(tv);

Can I some how programmatically know if bengali will render correctly or not?

  • This is because the font you're using lacks the Bengali glyphs. – Phantômaxx Sep 29 '15 at 13:59
  • The language is not even rendered in the browser. then what??? – Gaurav Bansal Sep 29 '15 at 14:00
  • 1
    Use a font which explicitly has the Bengali glyphs. – Phantômaxx Sep 29 '15 at 14:01
  • This is not the case with bengali... it is the case with many languages, they are not rendered correctly in the browsers also. I would like to know if i can somehow know beforehand if a language like isocode 'gu' or 'ta' will render correctly or not. @FrankN.Stein – Gaurav Bansal Sep 29 '15 at 14:02
  • I don't see HOW you can predict if a given language will be rendered. Maybe you could low-level check if a font includes a given Unicode UTF-8 glyph. The best way I can think of is to use specific fonts for specific languages other than "occidental" ones. – Phantômaxx Sep 29 '15 at 14:05
  • Given a language ISO Code, can i check if it is supported by android. @FrankN.Stein – Gaurav Bansal Sep 29 '15 at 14:11
  • Check out this post: http://stackoverflow.com/questions/15759507/android-get-list-of-supported-locales – Phantômaxx Sep 29 '15 at 14:15

2 Answers2

0

As @Frank N. Stein said, it's the font that your device uses in default settings. Here you will find a method to achieve your goal.

Community
  • 1
  • 1
CLOUGH
  • 691
  • 11
  • 16
0

You can check the list of supported languages that will render correctly here: http://www.oracle.com/technetwork/java/javase/locales-137662.html

Prasanth Louis
  • 4,658
  • 2
  • 34
  • 47