Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hindi text not rendered properly in android

I'm working on an app where I have to show text received from a server response in a textview. The text could be in English or Hindi. In case of hindi, some of the letter are replaced by question marks (?). What is the issue here? This is how I set my text. Android version 6. Font type- Proxima Nova Alt Regular

 for (int i = 0; i < 3; i++) {
 viewHolder.lines[i].setText(poem.lines[i].lineText);
 }

enter image description here

like image 816
Neanderthal Avatar asked Nov 21 '17 12:11

Neanderthal


People also ask

How can I use Hindi font in Android?

You can download hindi fonts from http://hindi-fonts.com and copy it in /system/font directory of your phone. The font will be installed.

How to check Hindi font?

Go to the Task Bar Start > Settings > Control Panel and Click on Fonts Icon. You will find fonts window appear. From this window click on File > Install New Font. You will find one more window Add Fonts - will appear.

Why Hindi font not displaying in MS word?

Hindi Content Not displayed in MS Word etc application. Solution: Install Hindi Unicode Font like Mangal, Arial Unicode MS, Aparajita etc. If you are using Windows XP or older windows OS, then you have to install Hindi Language pack also. After that you will see Hindi content and text in any application.


1 Answers

From your question, it seems that some letters are being rendered properly while others are not. This is obviously a font compatibility issue. Please download a new font for your version of the Android, if you want to use a custom font.

However, in many of the new Android devices (especially Android 6 and later), Hindi is supported by default. So in that case, just check Settings --> Language & input of your phone. If Hindi is supported, then just change Locale of the app to Hindi and it should work.

Configuration.Locale = new Locale("hi", "IN");
like image 190
Abhishek Avatar answered Sep 28 '22 01:09

Abhishek