Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

List of fonts available on IOS & Android? (without having to go to custom fonts)
Started by greg886 Jan 20 2014 03:23 AM

- - - - -
11 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

greg886

[GLOBAL: userInfoPane.html]
greg886
  • Contributor

  • 920 posts
  • Corona SDK

Is there a list of fonts that are available on IOS and Android that can be used with confidence?    

 

The ones listed in the Corona API are only:  native.systemFont & native.systemFontBold.  

 

That is searching for a way to easily add some different fonts without having to go to the custom font approach as detailed http://coronalabs.com/blog/2013/01/16/faq-wednesday-custom-fonts/ 

 

 

 



[TOPIC: post.html]
#2

Alex@Panc

[GLOBAL: userInfoPane.html]
Alex@Panc
  • Corona Geek

  • 1,733 posts
  • Corona SDK

Here's the link describing how to generate a list of fonts in the Simulator:

http://docs.coronalabs.com/api/library/native/getFontNames.html

[TOPIC: post.html]
#3

greg886

[GLOBAL: userInfoPane.html]
greg886
  • Contributor

  • 920 posts
  • Corona SDK

but (as I don't really understand how fonts work across devices) how do you know what the Simulator returns will be supported on IOS & Android?  Or perhaps you are saying that Corona have done the research and reflected this in their Simulator, hence if you look at common fonts that come back when running the app on the simulator in both IOS and Android mode this should give the answer?

 

thanks



[TOPIC: post.html]
#4

Alex@Panc

[GLOBAL: userInfoPane.html]
Alex@Panc
  • Corona Geek

  • 1,733 posts
  • Corona SDK

Correct, the fonts returned when using this feature are the fonts that Corona supports across all devices, regardless of OS. Hopefully this will apply to Windows Phone as well!



[TOPIC: post.html]
#5

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Corona Geek

  • 2,795 posts
  • Corona SDK

No offense but I don't think that statement is 100% accurate. Please refer to the first sentence in the Gotcha's section of that API. It says : 

 

The fonts available in the Simulator may be different from those available on your device. 

 

As for a definitive list, you can probably get this for IOS but for Android its nearly impossible as each device manufacturer adds their own fonts to the mix. Best is to stick to plain vanilla or supply your own if you wish to be absolutely sure. 



[TOPIC: post.html]
#6

Alex@Panc

[GLOBAL: userInfoPane.html]
Alex@Panc
  • Corona Geek

  • 1,733 posts
  • Corona SDK

OFFENSE TAKEN!  :P

 

Seriously, I have been using only custom fonts so I assumed what was returned was support across all devices. Shows how closely I read stuff! Sorry for showing you wrong, Greg!



[TOPIC: post.html]
#7

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Corona Geek

  • 2,795 posts
  • Corona SDK

Relieved!  :)



[TOPIC: post.html]
#8

elbowroomapps

[GLOBAL: userInfoPane.html]
elbowroomapps
  • Contributor

  • 353 posts
  • Corona SDK

For iOS, there is an app named "Fonts" by AppEngines. This app displays all of the fonts available on iOS devices.



[TOPIC: post.html]
#9

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,544 posts
  • Enterprise

If you run the code that dumps  the list of fonts, it does so based on what the device has.  What I see on my iPhone is different that on my Kindle Fire.  Be aware that running this code on your computer will take a long time to process if you're like me and have tons of installed fonts.

 

What you see in the sim is what you have on your Mac or PC, not what's on the device.  I use the same app that @elbowroomapps mentioned on my iOS devices.  I wrote an android app that dumps the fonts using the Corona list method that I use on my Android devices to get the font list.

 

Rob



[TOPIC: post.html]
#10

greg886

[GLOBAL: userInfoPane.html]
greg886
  • Contributor

  • 920 posts
  • Corona SDK

so overall Rob, better to invest the time into learning how to do custom fonts to be safe then right?



[TOPIC: post.html]
#11

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,544 posts
  • Enterprise

It depends on the application.  I've got a couple of apps that native.systemFont is fine.  I have another that I had to drop some if statements in my main.lua to define what fonts I wanted, but I used device fonts.  Then in another, it was call custom fonts.



[TOPIC: post.html]
#12

thegdog

[GLOBAL: userInfoPane.html]
thegdog
  • Contributor

  • 564 posts
  • Corona SDK

Custom fonts are not that difficult to get working.  If you are looking for fonts that can be used legally, I recommend looking at these sites:

http://www.fontsquirrel.com/

http://www.dafont.com/

 

They list which fonts are public domain, which are completely free, and which can be used commercially.

 

Unfortunately, some fonts don't play so well with mobile devices.  I've found a few that work poorly on Android, but work fine on iOS.  (I know, shocker!)  So adding a custom font will likely mean some more QA time for you.




[topic_controls]
[/topic_controls]