Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

What happens if I use an unsupported font?
Started by nml2727 Sep 30 2019 12:26 PM

7 replies to this topic
font

Best Answer XeduR @Spyric , 01 October 2019 - 05:02 AM

If you use an unsupported font or a font that isn't found then Corona will simply default to the system's default font.

 

When you use custom fonts, there is always a chance that whoever created the custom font didn't include some glyphs or data that are required by a specific OS. This happens more commonly with "solo designer fonts" who've just created a cool font for graphic design that is not actually meant for general use, i.e. typing in documents and such. If you happen to load a font like this, it'll fail and instead you get the system's default font.

 

There may also be slight differences with how fonts are rendered on different devices, e.g. on one devices a font might be a bit blurrier or they might be a pixel or two taller, etc. Personally, I prefer to use bitmap fonts with Corona as it allows for more customisation, such as fonts with stroke color, and bitmap fonts will always work across all devices and OS.

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

nml2727

[GLOBAL: userInfoPane.html]
nml2727
  • Enthusiast

  • 31 posts
  • Corona SDK

I've been reading that the main font for android devices is only Roboto....

 

Does this mean if I use some other font and someone with an android device downloads the game then all my font will be replaced by Roboto?

 

The docs say " there is no guarantee that any font will work across all platforms. Essentially, fonts are loaded by the operating system, and whether or not a particular font is supported depends on the platform and OS version"

 

Is this statement only referring to situations where I don't include the font file in my app?  Or even if I include the font file, does it still need to be supported by whatever device is trying to run the app?



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 944 posts
  • Corona SDK

  Best Answer

If you use an unsupported font or a font that isn't found then Corona will simply default to the system's default font.

 

When you use custom fonts, there is always a chance that whoever created the custom font didn't include some glyphs or data that are required by a specific OS. This happens more commonly with "solo designer fonts" who've just created a cool font for graphic design that is not actually meant for general use, i.e. typing in documents and such. If you happen to load a font like this, it'll fail and instead you get the system's default font.

 

There may also be slight differences with how fonts are rendered on different devices, e.g. on one devices a font might be a bit blurrier or they might be a pixel or two taller, etc. Personally, I prefer to use bitmap fonts with Corona as it allows for more customisation, such as fonts with stroke color, and bitmap fonts will always work across all devices and OS.



[TOPIC: post.html]
#3

nml2727

[GLOBAL: userInfoPane.html]
nml2727
  • Enthusiast

  • 31 posts
  • Corona SDK

Sorry for my ignorance, but how can I tell if a particular font is a "bitmap" font or not?

 

Regarding the "solo designer fonts", if I just find something mainstream from Google fonts I should be fine, right?



[TOPIC: post.html]
#4

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 944 posts
  • Corona SDK

Yes, fonts designed by larger organisations tend to be fine, but there may still be issues with some of them.

Bitmap fonts are not your usual fonts. They are fonts created using image sheets where each letter or glyph is created out of a single image, e.g. the string "hello" would be created out of five small images, one for each letter. One other benefit to using bitmap fonts is that they support kerning.



[TOPIC: post.html]
#5

nml2727

[GLOBAL: userInfoPane.html]
nml2727
  • Enthusiast

  • 31 posts
  • Corona SDK

Do you create your own bitmap fonts or is there a site you recommend where I could find some?



[TOPIC: post.html]
#6

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 944 posts
  • Corona SDK

I create my own and it is very easy to do.

You can google for "bitmap font generator" or creator, maker, editor, etc. There are both paid and free tools out there.



[TOPIC: post.html]
#7

nml2727

[GLOBAL: userInfoPane.html]
nml2727
  • Enthusiast

  • 31 posts
  • Corona SDK

Thanks for the info!



[TOPIC: post.html]
#8

Appletreeman

[GLOBAL: userInfoPane.html]
Appletreeman
  • Contributor

  • 450 posts
  • Corona SDK

There is a very good free online bitmap font generator at http://kvazars.com/littera/




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: font