Niranj Patel
Niranj Patel

Reputation: 33258

Multiple font Not working at time in application

Friends, Running out in a strange issue. I want to use two font (Gujarat & Hindi) in same applicaion. Here is process of install fonts in device

Issue

After reboot device I can read only that font which I installed last. Either Gujarati or Devangari

Note:- I am creating Only SoftKeyboard Apps which will work in all app, so I can't use Typeface class

I am just doing setText for read fonts..

textView1.setText("TextView1 ગુજરાતી");
textView2.setText("TextView2 हिन्दी ");

I want like this.

TextView1 ગુજરાતી
TextView2 हिन्दी

But I getting output like this

TextView1 ગુજરાતી
TextView2 ☐☐☐☐☐☐

or

TextView1 ☐☐☐☐☐☐☐
TextView2 हिन्दी

Note:- I am creating Only SoftKeyboard Apps which will work in all app, so I can't use Typeface class

Upvotes: 5

Views: 1252

Answers (2)

Manish Kumar
Manish Kumar

Reputation: 1125

Installing fonts with the help of Font Installer apps, just replace the DroidSansFallback.ttf file from /system/fonts. I suggestion you to merge the fonts of Hindi and Gujarati (in your case) into one, then install the font using your app. Now you can see both of your fonts.

Upvotes: 1

Waza_Be
Waza_Be

Reputation: 39564

Have you tried to place these fonts in your asset folder?

Typeface tf = Typeface.createFromAsset(this.getAssets(), "fonts/Lohit-Devanagari.ttf");
TextView tv = (TextView) findViewById(R.id.txtOnlyOne)
tv.setText("TextView1 ગુજરાતી");    
tv.setTypeface(tf);

Is root and fonts in system a requirement?

Upvotes: 1

Related Questions