5

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

  • Needed root device.
  • Install Font Installer App
  • Download Lohit-Devanagari.ttf & Lohit-Gujarati.ttf from this site
  • Copy ttf files file at /system/fonts
  • Given Read/Write Permission & installed both fonts
  • Reboot 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

Niranj Patel
  • 32,980
  • 10
  • 97
  • 133
  • can you show the code, which you are using to display text in font, you are specifying. – jeet Dec 01 '12 at 09:25

2 Answers2

1

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?

Waza_Be
  • 39,407
  • 49
  • 186
  • 260
1

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.

Manish Kumar
  • 1,095
  • 9
  • 19
  • hello, how can we merge two fonts, any link for that? and when I replace font with DroidSansFallback.ttf and my fonts may be not support then what happen ??, is will system crash ? – Niranj Patel Dec 04 '12 at 05:37
  • [Check this question](http://stackoverflow.com/questions/9910301/css-fonts-howto-convert-multiple-ttf-files-into-one-file) – Niranj Patel Dec 04 '12 at 05:39
  • 1
    There are so many tools available on internet, one is CORAL-DRAW, which give you to make your own fonts or edit them. Merge your fonts into one. If you replace your font file with DroidSansFallback.ttf, then the fonts you merge in the file will be supportable into your system. So don't worry. – Manish Kumar Dec 04 '12 at 05:43