Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Can't load custom font on Android
Started by tiago84 Mar 06 2018 09:09 AM

1 reply to this topic
android coronacards font
[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

tiago84

[GLOBAL: userInfoPane.html]
tiago84
  • Observer

  • 4 posts
  • Corona SDK

Hey there,

 

It seems that loading a font through CoronaCards on Android doesn't work. It works perfectly on the Corona Simulator.

 

Here's the log displayed  :I/System.out: WARNING: Could not load font assets/fonts/gulkave.ttf. Using default.

 

Here's the lua code :

local fontName = "assets/fonts/gulkave.ttf"
display.newText( message:upper(), screenW/2, screenH/2 + 20, fontName, defaultSize )

I have tried many fonts format and files : otf, ttf.

 

The folder is like this :

assets (android folder) -> coronagame -> *.lua (all the lua files, including the one loading the font), assets -> fonts -> gulkave.ttf

 

Please let me know if there's any specific behavior to change or if you have any idea on why it doesn't work.

 

Thanks!

 

 



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,743 posts
  • Corona Staff

Android is a case-sensitive operating system. Are you sure the filename and the path to it are all lower case?

Also, please try leaving off the .ttf.

 

Rob




[topic_controls]
[/topic_controls]