List to all the fonts?

Hey,

Im sorry for asking such a small question, but could someone give me a list to all the fonts available in Corona? I am trying to change the style of the text in my games scoring system. Thanks! [import]uid: 175550 topic_id: 31018 reply_id: 331018[/import]

Hello @rooldacool,

You can view the “system” fonts by using the method described in the following post:
http://docs.coronalabs.com/api/library/native/getFontNames.html

You can also easily add your own custom font by just adding the appropriate font to your project directory and then calling it by the name that is output by the above function. Of course, you should have all legal usage rights for that font! :slight_smile:

Sincerely,
Brent Sorrentino
[import]uid: 9747 topic_id: 31018 reply_id: 124021[/import]

Thanks so much! Could you list the names of a couple common fonts compatible for everything? [import]uid: 175550 topic_id: 31018 reply_id: 124022[/import]

There really isn’t such a list.

Android only has Droid Sans, Droid Sans Mono and whatever their Droid Serif font. That’s the total list.

For iOS there are probably 100 fonts available. For Kindle Fire, they include the Microsoft public fonts like Arial, New Times Roman and Courier which are also on iOS. The Nook has a smaller set of fonts, but some of the common Microsoft fonts are not among them.

Georgia, a nice Serif font is common to everything but Android with one catch. The font name on iOS and the Nook is “Georgia”, on the Kindle Fire, its “georgia” and the case is enough that you have to code like you’re using a different font.

You can build this little app and install it on the device you want and it will dump the fonts for you:

local v = {}  
v[1] = display.newText(system.getInfo("name"),0,0, "Helvetica", 18)  
v[2] = display.newText(system.getInfo("model"),0,0, "Helvetica", 18)  
v[3] = display.newText(system.getInfo("platformName"),0,0, "Helvetica", 18)  
v[4] = display.newText(system.getInfo("platformVersion"),0,0, "Helvetica", 18)  
v[5] = display.newText(system.getInfo("build"),0,0, "Helvetica", 18)  
v[6] = display.newText(system.getPreference("ui", "language"),0,0, "Helvetica", 18)  
  
for i = 1, #v do  
 v[i]:setReferencePoint(display.TopLeftReferencePoint)  
 v[i].y = i \* 20  
 v[i].x = 10  
end  
  
local fonts = native.getFontNames()  
  
local fontStr = {}  
local i = 1  
local col = 1  
local row = 1  
for k, v in pairs(fonts) do  
-- print(k,v)  
 fontStr[i] = display.newText(v .. " ??? ?????",0,0,v,14)  
 fontStr[i]:setReferencePoint(display.TopLeftReferencePoint)  
 fontStr[i].y = row \* 18 + 128  
 fontStr[i].x = 10 + (col - 1) \* 290  
 col = col + 1  
 if col \> 2 then  
 col = 1  
 row = row + 1  
 end  
 i = i + 1  
end  

Just be aware when loading it into the simulator it will try to build a list of all the fonts on your Mac or PC and it’s REALLY SLOW… Must faster on the device since there are fewer fonts.

[import]uid: 19626 topic_id: 31018 reply_id: 124047[/import]

Since fewer people have the Nook, here are it’s fonts:

Trebuchet
Trebuchet-Italic
Trebuchet-Bold
Trebuchet-BoldItalic

GillSans
GillSans-Bold
GillSans-Italic
GillSans-BoldItalic

Georgia
Georiga-Bold
Georiga-Italic
Georgia-BoldItalic

Dutch
Dutch-Bold
Dutch-Italic
Dutch-BoldItalic

DroidSerif-Regular
DroidSerif-Bold
DroidSerif-Italic
DroidSerif-BoldItalic

DroidSansMono
DroidSansFallback
DroidSans
DroidSans-Bold

Clockopia

CentrualSchoolBook
CentrualSchoolBook-Bold
CentrualSchoolBook-Italic
CentrualSchoolBook-BoldItalic

AscenderSans
AscenderSans-Bold
AscenderSans-Italic
AscenderSans-BoldItalic

Georiga, GillSans, and kind of Trebuchet are common between the Nook and iOS. On iOS Trebuche is:

TrebuchetMS
TrebuchetMS-Bold
TrebuchetMS-Italic
Trebuchet-BoldItalic – note the missing MS…

Font’s are so much fun.

[import]uid: 19626 topic_id: 31018 reply_id: 124050[/import]

Hello @rooldacool,

You can view the “system” fonts by using the method described in the following post:
http://docs.coronalabs.com/api/library/native/getFontNames.html

You can also easily add your own custom font by just adding the appropriate font to your project directory and then calling it by the name that is output by the above function. Of course, you should have all legal usage rights for that font! :slight_smile:

Sincerely,
Brent Sorrentino
[import]uid: 9747 topic_id: 31018 reply_id: 124021[/import]

Thanks so much! Could you list the names of a couple common fonts compatible for everything? [import]uid: 175550 topic_id: 31018 reply_id: 124022[/import]

There really isn’t such a list.

Android only has Droid Sans, Droid Sans Mono and whatever their Droid Serif font. That’s the total list.

For iOS there are probably 100 fonts available. For Kindle Fire, they include the Microsoft public fonts like Arial, New Times Roman and Courier which are also on iOS. The Nook has a smaller set of fonts, but some of the common Microsoft fonts are not among them.

Georgia, a nice Serif font is common to everything but Android with one catch. The font name on iOS and the Nook is “Georgia”, on the Kindle Fire, its “georgia” and the case is enough that you have to code like you’re using a different font.

You can build this little app and install it on the device you want and it will dump the fonts for you:

local v = {}  
v[1] = display.newText(system.getInfo("name"),0,0, "Helvetica", 18)  
v[2] = display.newText(system.getInfo("model"),0,0, "Helvetica", 18)  
v[3] = display.newText(system.getInfo("platformName"),0,0, "Helvetica", 18)  
v[4] = display.newText(system.getInfo("platformVersion"),0,0, "Helvetica", 18)  
v[5] = display.newText(system.getInfo("build"),0,0, "Helvetica", 18)  
v[6] = display.newText(system.getPreference("ui", "language"),0,0, "Helvetica", 18)  
  
for i = 1, #v do  
 v[i]:setReferencePoint(display.TopLeftReferencePoint)  
 v[i].y = i \* 20  
 v[i].x = 10  
end  
  
local fonts = native.getFontNames()  
  
local fontStr = {}  
local i = 1  
local col = 1  
local row = 1  
for k, v in pairs(fonts) do  
-- print(k,v)  
 fontStr[i] = display.newText(v .. " ??? ?????",0,0,v,14)  
 fontStr[i]:setReferencePoint(display.TopLeftReferencePoint)  
 fontStr[i].y = row \* 18 + 128  
 fontStr[i].x = 10 + (col - 1) \* 290  
 col = col + 1  
 if col \> 2 then  
 col = 1  
 row = row + 1  
 end  
 i = i + 1  
end  

Just be aware when loading it into the simulator it will try to build a list of all the fonts on your Mac or PC and it’s REALLY SLOW… Must faster on the device since there are fewer fonts.

[import]uid: 19626 topic_id: 31018 reply_id: 124047[/import]

Since fewer people have the Nook, here are it’s fonts:

Trebuchet
Trebuchet-Italic
Trebuchet-Bold
Trebuchet-BoldItalic

GillSans
GillSans-Bold
GillSans-Italic
GillSans-BoldItalic

Georgia
Georiga-Bold
Georiga-Italic
Georgia-BoldItalic

Dutch
Dutch-Bold
Dutch-Italic
Dutch-BoldItalic

DroidSerif-Regular
DroidSerif-Bold
DroidSerif-Italic
DroidSerif-BoldItalic

DroidSansMono
DroidSansFallback
DroidSans
DroidSans-Bold

Clockopia

CentrualSchoolBook
CentrualSchoolBook-Bold
CentrualSchoolBook-Italic
CentrualSchoolBook-BoldItalic

AscenderSans
AscenderSans-Bold
AscenderSans-Italic
AscenderSans-BoldItalic

Georiga, GillSans, and kind of Trebuchet are common between the Nook and iOS. On iOS Trebuche is:

TrebuchetMS
TrebuchetMS-Bold
TrebuchetMS-Italic
Trebuchet-BoldItalic – note the missing MS…

Font’s are so much fun.

[import]uid: 19626 topic_id: 31018 reply_id: 124050[/import]