How to display hindi font in Android webview

Go To StackoverFlow.com

4

How can we display hindi in android webview for this i got sample from github but that is for tamil,there using content like this :

jpUkiy nfhOk;G Fz;LtPr;R epfo;Tfisg; ghu;f;f Kd;du; ,e;j epfo;tpd; jhf;fj;ijNa khw;wpaikj;j xUtiug; gw;wp rpy tupfs; vOjNtz;Lk;.

ypadhu;l; gpu;rhy; (Leonard Birchall) xU fNdba tpkhd Xl;b. rpWtajpy; ,Ue;Nj ,tupw;F gwf;Fk; Mir. xe;jhupNah khdpyj;jpy; gpwe;j ,tu; 1933 ,y; Nuhay; fNdba ,uhZtf; fy;Y}upapy; gbj;Jg; gl;lk; ngw;whu;. 1937 ,y; jdJ gapw;rpia Kbj;J fNdba Nwhay; tpkhdg; gilapy; tpkhd Xl;bahf ,ize;J nfhz;lhu;.

n\l;yhd;l; jPTfspy; jdJ gzpia Vw;Wf; nfhz;l ypNahdhl; gpd;du; Ig;ghdpau;fs; njd; fpof;F Mrpa ehLfisf; ifg;gw;wj; njhlq;fpaJk; ,yq;iff;F khw;wg;gl;lhu;. ,yq;ifapy; gwe;J fz;fhzpg;Gr; nra;Ak; gzpapy; ,tu;

4 Vg;uy; 1942 md;W ypadhu;l; nfhf;fiy gpuNjrj;jpy; ,Ue;J gwf;Fk; glF (mJjhd; ePupy; jiuapwq;Fk; tpkhdk;) fl;lyPdhtpy; Vwpg; gwf;fj; njhlq;fpdhu;. Rkhu; thdj;jpy; vl;L kzp Neuq;fs; Rw;wp fz;fhzpg;G gzpapy;

ngupa Ig;ghdpaf; flw;gilj; njhFjp xd;W ,yq;if Nehf;fp tpiue;Jnfhz;bUe;jJ. ,jpy; Ie;J tpkhde; jhq;fpf; fg;gy;fSk; ,Ue;jJ. gu gug;ghd ypadhl; jdJ tpkhdj;jpy; ,Ue;j rf tPuu;fs; %yk; jiuf;F jftiy tpiue;J njuptpj;jhu;.

,tu;fspd; tpkhdj;ijf; fz;l Ig;ghdpa fg;gy; jkJ fg;gypy; ,Ue;J jhf;Fjy; tpkhdj;ij Vtp ypadhu;l;bd; tpkhdj;ij Nehf;fpr; Rlj;njhlq;fpaJ. ntWk; fz;fhzpg;G tpkhdk; vd;gjdhy; jpUg;gpr; rz;il $lg; Nghl Kbahky; R+L gl;L flypy; tPo;e;jJ ypadhu;l; gadpj;j fl;lyPdh ,uf tpkhdk;.

what is the format this how can we get this for particular text is there any converter ? please help me on this..

Thanks in Advance..

2012-04-04 08:13
by user1285293
i am facing the same problem - hitesh141 2015-05-14 06:25


0

You have to put the hindi font, whichever you want to use in the asset folder of your project and from there you can use the font using css.
The detailed explanation is posted in this question

2012-04-04 08:18
by noob
Thanks for your reply ,in assets folder we need to keep .ttf file ,in my question they have used some convertion for required language the above data is for tamil ,what i need exactly is how they are converting that and on which basis and what is that format - user1285293 2012-04-05 05:19
You want it in Tamil or in Hindi? If you want it in Hindi, just put Hindi font in asset and use it in css. Same with Tamil - noob 2012-04-05 05:33
Thanks for your reply, do you have any sample to display hindi font in webview can you please share. - user1285293 2012-04-05 07:11
Sorry don't have any code for that, though I used it. Check the link I posted in my answer. It'll help you - noob 2012-04-05 08:36


0

You gonna have to use following CSS hack :) Make sure to use non-unicode font. Unicode fons fails in it.

@font-face {
 font-family: MyCustomFont;
 src: url("file:///android_asset/Bamini.ttf") /* TTF file for CSS3 browsers */
}

and

body {
 font-family: MyCustomFont, Verdana, Arial, sans-serif;
 font-size: medium;
 color: black
}

Refer my opensource project @ GitHub for detail informaion.

You can find many online font converters. For example I have used Bamini font converter available at Suratha's site

Good luck.

2012-04-26 11:50
by Jay Mayu
Ads