Text wrapping unexpectedly on newText user for showing a timer

I’m having trouble with some fonts wrapping my timer text. As seen in the attached images. Sometimes it’s fine, like for the number 20. But sometimes the second part wraps to a new line. Here’s how I construct the timer text.
 

    local startTimeText = runtime.saveData.time     self.timeText = display.newText({         text = startTimeText,         x = HSCREENW,         y = SCREENH\*0.15,         width = display.contentWidth,         height = 300,         font = font.bold,         fontSize = 100,         align = "center"     })     self.timeText:setFillColor(1)     self.gameGroup:insert(self.timeText)

As you see, the font size is a 100 and it has plenty of space with a height of 300 and a width of the entire display (~1200 units).

It seems to work on sizes smaller than 100 but not larger. It also seems to work on some fonts but not others. The only difference I’ve found is that Windows lists those not working as “OpenType layout, TrueType outlines” and those working as “TrueType outlines”. Could that be the problem? If, so can I convert these outlines in some way?

I’d like to try and see what’s going on here, but I don’t have enough information.  Can you post the config.lua you are using.  What font are you using?  What values are HSCREENW and SCREENH.

Thanks

Rob

Sure, I think the config.lua is from one of your blog posts. I’ve tried the fonts Geosans Light, Aliquam Regular, Franchise Bold Hinted and Gotham Light, of which only Geosans worked. The constants are just quick versions of contentWidth/height:

SCREENW, SCREENH, HSCREENW, HSCREENH = display.contentWidth, display.contentHeight, display.contentWidth\*0.5, display.contentHeight\*0.5

--calculate the aspect ratio of the device local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 800 or math.ceil( 1200 / aspectRatio ), height = aspectRatio \< 1.5 and 1200 or math.ceil( 800 \* aspectRatio ), scale = "letterBox", fps = 60, &nbsp; imageSuffix = { &nbsp; &nbsp; &nbsp;["@2x"] = 1.3, &nbsp; }, }, }

I can’t get my simulator to show this problem.  What version of CoronaSDK are you using?  Is this happening on the device or in the Sim?  What operating system are you running on?

Can you put in some prints and print out the width and height of your text object after it’s created?

Thanks Rob.

Corona SDK version: 2014.2189

Windows 7 Home Premium SP1

Both sim and device but ONLY with the fonts i described. Geosans Light works as expected as previously stated.

Prints reports size as width: 1420 height: 300 regardless of working or non-working fonts.

Well I have a Mac so I can’t try and reproduce this.  Can you try to set the width to something a bit more practical, like day less than 1024 and see what happens?

Thanks

Rob

I tried with 600 which should be more than enough. No one’s had a similar problem? I’ll stick with the font that works for now. But I’ll keep trying as long as there are things to try. Maybe someone with a pc could reproduce it.

I’d like to try and see what’s going on here, but I don’t have enough information.  Can you post the config.lua you are using.  What font are you using?  What values are HSCREENW and SCREENH.

Thanks

Rob

Sure, I think the config.lua is from one of your blog posts. I’ve tried the fonts Geosans Light, Aliquam Regular, Franchise Bold Hinted and Gotham Light, of which only Geosans worked. The constants are just quick versions of contentWidth/height:

SCREENW, SCREENH, HSCREENW, HSCREENH = display.contentWidth, display.contentHeight, display.contentWidth\*0.5, display.contentHeight\*0.5

--calculate the aspect ratio of the device local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 800 or math.ceil( 1200 / aspectRatio ), height = aspectRatio \< 1.5 and 1200 or math.ceil( 800 \* aspectRatio ), scale = "letterBox", fps = 60, &nbsp; imageSuffix = { &nbsp; &nbsp; &nbsp;["@2x"] = 1.3, &nbsp; }, }, }

I can’t get my simulator to show this problem.  What version of CoronaSDK are you using?  Is this happening on the device or in the Sim?  What operating system are you running on?

Can you put in some prints and print out the width and height of your text object after it’s created?

Thanks Rob.

Corona SDK version: 2014.2189

Windows 7 Home Premium SP1

Both sim and device but ONLY with the fonts i described. Geosans Light works as expected as previously stated.

Prints reports size as width: 1420 height: 300 regardless of working or non-working fonts.

Well I have a Mac so I can’t try and reproduce this.  Can you try to set the width to something a bit more practical, like day less than 1024 and see what happens?

Thanks

Rob

I tried with 600 which should be more than enough. No one’s had a similar problem? I’ll stick with the font that works for now. But I’ll keep trying as long as there are things to try. Maybe someone with a pc could reproduce it.