Trying to eliminate Windows font error messages...

a. Helvetica Neue Bold sounds like a great iOS font.
b. In fact, the widgets use it by default!
c. This leads me to two questions:

  1. Has anybody actually managed to get that font working in the Windows simulator? Widgets don’t throw an error but literally no text appears with widget.newButton, for instance. Or is there some “space in names” bug I’m missing?

  2. Is this font part of xCode or OSX? Or is it just as mythical on both builds?

Cheers :slight_smile: [import]uid: 41884 topic_id: 14973 reply_id: 314973[/import]

Make sure you have the font installed in windows itself, simulator requires them to be installed in windows otherwise it reverts to default, also make sure to restart simulator after font installation to reload fonts. [import]uid: 67185 topic_id: 14973 reply_id: 55278[/import]

Yeah, the process was:

  1. Install in Windows
  2. Use the command (see API Doc) to find out the internal font name.
  3. Specify the internal font name when using the newText function.
  4. Restart simulator

But like I said, nothing.

I’m wondering if Corona has problems with internal font names that have spaces in them…
[import]uid: 41884 topic_id: 14973 reply_id: 55350[/import]

Did you also add the font to config.lua ? And place a copy in your project directory? [import]uid: 84637 topic_id: 14973 reply_id: 55355[/import]

You’ll have to explain this one to me, Danny.

local temptext = display.newText("Hi there!", 50, 50, "Helvetica Neue", 14) local tempbutton = widget.newButton{ x=50, y=100, label="My Button", onEvent = pressButton, font = "Helvetica Neue" }

  1. The font file Helvetica Neue.ttf is in the project directory.
  2. It’s also installed in Windows.
  3. Using the command to list all available fonts through the debug window, it shows up as Helvetica Neue
  4. Ansca’s page on config.lua does not mention the word font even once. Search comes up empty, too. (I’d strongly suggest explaining how you mean to add this stuff there, if you can)

Still, I tried adding this:

application = { content = { font = "Helvetica Neue" }, }

And nothing. No errors thrown. It’s as if I never specified a font. The Widget comes up blank and anything else that I specify the font with just reverts to default. (If I specify a knowingly wrong font, say, " ", the widget reverts to native.systemfont. I suspect this means it is trying to use the specified font but something else is blocking it.)

So…either I’m doing something wrong with config.lua’s (undocumented?) font registration, or I’m missing something else?

Also, does config.lua need to be included in? I tried it and nothing changed, but I can’t find any info on whether that is automatically included or not.
[import]uid: 41884 topic_id: 14973 reply_id: 55428[/import]

Here is the link on including ttf fonts in your app/game : http://developer.anscamobile.com/content/display-objects#Using_a_custom_font

config.lua is very useful yes, and is automatically included by Corona when you run or build. [import]uid: 84637 topic_id: 14973 reply_id: 55468[/import]

Yeah, but that’s just how to put the font into build.settings. The entry has no mention at all about config.lua for custom fonts, hence my confusion.

(I can try and just paste that entire snippet into my config.lua, but I figured they had different formats since every config.lua I’ve seen is laid out differently than the build.settings files I’ve seen.) [import]uid: 41884 topic_id: 14973 reply_id: 55518[/import]

Sorry yes you are right that is for build.settings.

Have you tried different fonts? Does the error appear for all of them? Are they ttf fonts?

Try this font : http://www.dafont.com/space-age.font

(the first one listed)

That is a spaced font name “space age” and works for me [import]uid: 84637 topic_id: 14973 reply_id: 55521[/import]

(Ugh, sorry, totally forgot about this thread due to other code bugs of my own design)

Yes, Danny, that font does work. Which begs the question, what is different between the two and how could I find that out?

More importantly though, I’d love to hear a response to my original question - is Helvetica Neue something I can expect as a standard part of xCode/OSX? (Is this simply just a windows issue I’m having because I don’t have the proper Helvetica Neue font that the Mac does, I mean? Because it’s clearly not shipped with W7)

:slight_smile: [import]uid: 41884 topic_id: 14973 reply_id: 56120[/import]