Vishal Khakhkhar
Vishal Khakhkhar

Reputation: 2116

Gujarati Font Rendering

I am having sqlite database containing gujarati words..

The sql query for the database is...

BEGIN TRANSACTION;
CREATE TABLE eng_guj (_id INTEGER PRIMARY KEY, eng_word , guj_word );
INSERT INTO eng_guj VALUES(1,'aardvark','ઊધઇ ખાનારું આફ્રિકાનું એક નિશાચર સસ્તન પ્રાણી.');
COMMIT;

I want to display the text in textview.. but its not rendering properly.. meant Its displaying the word in gujarati like "આફ્રિકા" will be displayed as "આફરિકા".

I already have used Typeface and different ttf fonts.

enter image description here

Upvotes: 9

Views: 3056

Answers (3)

Siddhpura Amit
Siddhpura Amit

Reputation: 15078

i have found that it's problem with android phone only, above 2.3 it's working fine

so build your apps with above android version 2.3

it will work sure for all android version above 2.3

like in AndroidManifest.xml file android:minSdkVersion should be more than 10,

<uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="17" />

Upvotes: 1

Zala Janaksinh
Zala Janaksinh

Reputation: 2927

I had the same problem as you. I downloaded the Shruti Font here.

Then using this code display the Gujarati font:

txtHeading=(TextView) findViewById(R.id.txtHeading);
            Typeface typeface=Typeface.createFromAsset(this.getAssets(), "SHRUTI.TTF");
            txtHeading.setTypeface(typeface);
txtHeading.setText("StackOverFlow પર આપનું સ્વાગત છે.");

Upvotes: 0

Dipan Mehta
Dipan Mehta

Reputation: 2160

This implies that your UI framework is handling "Complex text layout" properly or it is not configured properly to handle right.

Devanagari scripts, require different contextual shapes and ordering in text, which require complex layout support with Unicode characters. see this

A forum here mentions that Android still doesn't have proper support to do this. But my information on this is limited.

Dipan.

Upvotes: 1

Related Questions