Widget.newButton (WARNING)

So ever since i can remember there has been this warning that popped up in the console after adding a widget.newButton.

Warning: Could not load font Helvetica-bold. Using default font.

I mean its not in the way of anything its just gets annoying when i have a lot of buttons in my scenes and the warning pops up for every one of them… 

Is there a fix? If there is then how do i do it?

Also i’m in windows.

UPDATE – From reading other posts it seems like its a bug or something but doesn’t do anything but piss people off because its really annoying when trying to debug, and i totally agree! Haha

Here’s some code for what im doing if you need it…

local Btn = widget.newButton { top = 320, left = 110, width = 100, height = 100, defaultFile = "Btn.png", overFile = "Btn2.png", onEvent = goToNextScene } sceneGroup:insert(Btn)

Thanks!

The default font for the button is Helvetica-Bold. You can set your own font using the font property for widget.newButton. See:

https://docs.coronalabs.com/api/library/widget/newButton.html

Rob

Thanks Rob! I set 

font = native.systemFont,

for every widget.newButton and everything is perfect now!

Thanks Again!

i wonder why corona is using a font that may or not be installed in a user computer, instead of using native.systemFont by default in the widget.

Exactly! I don’t understand that either… Maybe its a small bug no one cared about? I feel like its so small that even if i submit a bug report that they wont have the time to fix it haha

Hi guys,

Let me clarify a little on this point. The default button font is not"Helvetica-Bold". I just checked the framework code, and it picks the font based in this order:

  1. The user-defined font as set in the widget creation.

  2. OR the font defined as the overall widget “theme”. This will  be “HelveticaNeue-Light” if you set “widget_theme_ios7” as the theme, or let iOS auto-select it. However, since Apple changed the system font in iOS 9 to “San Francisco”, our widgets don’t auto-select this (yet). We will probably update the widget framework to simply choose the system font on all iOS versions.

  3. OR the native system font.

So basically, it’s unlikely that you’ll ever reach #3 because all themes have a related font which is suitable to that OS, but it’s technically possible.

In any case, if you want a specific font for a widget, just specify it… don’t let it default to something you might not desire.

Best regards,

Brent

hi, brent. thanks for the clarification . this kinda of usefull info should be in the widget doc.

The default font for the button is Helvetica-Bold. You can set your own font using the font property for widget.newButton. See:

https://docs.coronalabs.com/api/library/widget/newButton.html

Rob

Thanks Rob! I set 

font = native.systemFont,

for every widget.newButton and everything is perfect now!

Thanks Again!

i wonder why corona is using a font that may or not be installed in a user computer, instead of using native.systemFont by default in the widget.

Exactly! I don’t understand that either… Maybe its a small bug no one cared about? I feel like its so small that even if i submit a bug report that they wont have the time to fix it haha

Hi guys,

Let me clarify a little on this point. The default button font is not"Helvetica-Bold". I just checked the framework code, and it picks the font based in this order:

  1. The user-defined font as set in the widget creation.

  2. OR the font defined as the overall widget “theme”. This will  be “HelveticaNeue-Light” if you set “widget_theme_ios7” as the theme, or let iOS auto-select it. However, since Apple changed the system font in iOS 9 to “San Francisco”, our widgets don’t auto-select this (yet). We will probably update the widget framework to simply choose the system font on all iOS versions.

  3. OR the native system font.

So basically, it’s unlikely that you’ll ever reach #3 because all themes have a related font which is suitable to that OS, but it’s technically possible.

In any case, if you want a specific font for a widget, just specify it… don’t let it default to something you might not desire.

Best regards,

Brent

hi, brent. thanks for the clarification . this kinda of usefull info should be in the widget doc.