2

I added a custom font to a newEmbossedText, however when i view it in game, it appears tiny even though the font-size argument is 60.

  local scoreText = display.newEmbossedText(group, currentScore, 0, 0, "Infinium-Guardian", 60);
  • What resolution are you runnning at? Have you tried doubling the size to 120 to see if it registers correctly? There is nothing wrong in the code you provided. – Nicklas Kevin Frank Aug 13 '14 at 09:21
  • no matter how much i change the size it stays miniscule –  Aug 13 '14 at 09:22
  • Try `scoreText.size = 60` and/or `scoreText:setSize(60)`, if that does not work then you must include more code for us to help. – Nicklas Kevin Frank Aug 13 '14 at 09:23
  • The font is included in build settings as UIAppFonts, is there an alternate way to achieve this effect? –  Aug 13 '14 at 09:28
  • Try not using EmbossedText (i.e, use just display.newText) to see if it is a bug related to the embossed function. Also, the way that you are using to call the function is deprecated. You should pass a table as argument (See more here: http://docs.coronalabs.com/api/library/display/newEmbossedText.html) – rsc Aug 14 '14 at 00:15

1 Answers1

1

For displaying custom font in Corona Simulator, you have to install the font in your system, and get the correct name of the font. When I tried with the same font, the font name string was:

"Infinium Guardian"

So, try changing your code as below, and check again:

local scoreText = display.newEmbossedText("Test String", 0, 0, "Infinium Guardian", 100);

enter image description here

Hope this could solve your issue.

For more information about integrating custom-fonts in your corona app, you can refer my answer on the post: How do you integrate custom fonts in an app?

Keep coding .................. :)

Community
  • 1
  • 1
Krishna Raj Salim
  • 7,331
  • 5
  • 34
  • 66