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);
}
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.
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.
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.
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");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With