[Resolved] Custom fonts for android devices

How to use custom fonts in android?..I tried that is mentioned in this blog http://www.coronalabs.com/blog/2011/07/13/custom-fonts-corona/#more-8294
But it dint work… error showed up could not load Harrowprint…!! [import]uid: 148046 topic_id: 31226 reply_id: 331226[/import]

Hi pratikdhake,

You have to put the exact name of the font in there. Not the file name, tha actual font name.

-Landon [import]uid: 111492 topic_id: 31226 reply_id: 124867[/import]

Hii landon,

I tried using actual font name which is “Harrowprint” in the above case but still the same error occured…!!

-Pratik [import]uid: 148046 topic_id: 31226 reply_id: 124869[/import]

I had this same problem. Try this software

http://www.cr8software.net/typelight.html

it a font editor/creator. Open up the font and resave it. You can set its name to whatever… Its been awhile but if I remember correctly when I had the problem the font was actually named something slightly different within the font file and that was why it didn’t work
[import]uid: 55582 topic_id: 31226 reply_id: 124882[/import]

@attudesign

Dint work…:frowning: [import]uid: 148046 topic_id: 31226 reply_id: 124884[/import]

wait a sec… it should have

font I’m using 04b08

in type light, open the font
in the dropdown ‘Font’ open ‘Names’
set ‘Family Name’ and ‘Full Name’ to the same thing… this is what goes in below for the font name in corona. Now resave the font. put it in the root directory of your corona app.

to use the font in corona

display.newText( “####”, 10, 20, “04b08”, 20 )

I know this works… I played around with the custom font problem for awhile till I got this to fix it. I’ve tried it with 2 different physical devices running 2.2.3 and 3.x, a tablet and phone… works on both [import]uid: 55582 topic_id: 31226 reply_id: 124888[/import]

Try fontsquirrel.com - font-face generator. I had a TTF that didn’t work with Corona, ran it through that, used it and it worked. [import]uid: 160496 topic_id: 31226 reply_id: 124889[/import]

sorted out the problem…!!
some of the ttf files dosn’t work on simulator…they are working fine on android device…!!

-Thanks [import]uid: 148046 topic_id: 31226 reply_id: 124892[/import]

If the font isn’t showing up in the simulator make sure you also have it installed on your computer - this is normally the culprit.

Peach :slight_smile: [import]uid: 52491 topic_id: 31226 reply_id: 124931[/import]

@Peach Pallen…Tried that too…but it dint work for the first time…but then I tried typing the actual font name…and it worked on simulator but doesn’t work on device…android device needs the filename and simulator needs the actual font name…!!..Everything sorted out finally…:slight_smile:

-Thanks [import]uid: 148046 topic_id: 31226 reply_id: 124973[/import]

Hi pratikdhake,

You have to put the exact name of the font in there. Not the file name, tha actual font name.

-Landon [import]uid: 111492 topic_id: 31226 reply_id: 124867[/import]

Hii landon,

I tried using actual font name which is “Harrowprint” in the above case but still the same error occured…!!

-Pratik [import]uid: 148046 topic_id: 31226 reply_id: 124869[/import]

I had this same problem. Try this software

http://www.cr8software.net/typelight.html

it a font editor/creator. Open up the font and resave it. You can set its name to whatever… Its been awhile but if I remember correctly when I had the problem the font was actually named something slightly different within the font file and that was why it didn’t work
[import]uid: 55582 topic_id: 31226 reply_id: 124882[/import]

@attudesign

Dint work…:frowning: [import]uid: 148046 topic_id: 31226 reply_id: 124884[/import]

wait a sec… it should have

font I’m using 04b08

in type light, open the font
in the dropdown ‘Font’ open ‘Names’
set ‘Family Name’ and ‘Full Name’ to the same thing… this is what goes in below for the font name in corona. Now resave the font. put it in the root directory of your corona app.

to use the font in corona

display.newText( “####”, 10, 20, “04b08”, 20 )

I know this works… I played around with the custom font problem for awhile till I got this to fix it. I’ve tried it with 2 different physical devices running 2.2.3 and 3.x, a tablet and phone… works on both [import]uid: 55582 topic_id: 31226 reply_id: 124888[/import]

Try fontsquirrel.com - font-face generator. I had a TTF that didn’t work with Corona, ran it through that, used it and it worked. [import]uid: 160496 topic_id: 31226 reply_id: 124889[/import]

sorted out the problem…!!
some of the ttf files dosn’t work on simulator…they are working fine on android device…!!

-Thanks [import]uid: 148046 topic_id: 31226 reply_id: 124892[/import]

If the font isn’t showing up in the simulator make sure you also have it installed on your computer - this is normally the culprit.

Peach :slight_smile: [import]uid: 52491 topic_id: 31226 reply_id: 124931[/import]

@Peach Pallen…Tried that too…but it dint work for the first time…but then I tried typing the actual font name…and it worked on simulator but doesn’t work on device…android device needs the filename and simulator needs the actual font name…!!..Everything sorted out finally…:slight_smile:

-Thanks [import]uid: 148046 topic_id: 31226 reply_id: 124973[/import]