Multiline text display is inconsistant between Windows Simulator and Apple and IOS

Hi,

I’ve reached my wits end on this issue.  I use the following code to display multiline text:

local NPoptions =
{
  text = “”,
   width = 350,     --required for multi-line and alignment
 height = notepadpaper.height+130,
 font = gameSettings.handprintedFont,
    fontSize = 16,
    align = “left”  --new alignment parameter
}

notepadText = display.newText( NPoptions )
notepadText:setTextColor(0, 0, 0)
notepadText.x = notepadpaper.x  - 175
notepadText.y = notepadpaper.y
notepadText:toFront()
notepadText:setReferencePoint(display.CenterReferencePoint);
notepad_read_flag = “true”
popupNotepadGroup:insert( notepadText )
NPoptions = nil

I set the text value later on.  When I display it on Windows it looks fine.  When I display it in the simulator and IOS the height of the text is all wrong.  It does not fill out the background page I’ve displayed.  Everything else looks correct (font type).

Shouldn’t this display exactly the same in the Windows simulartor VS Apple simulator?

Any ideas why this might be?

Thanks,

Arthur

Corona SDK accesses the operating system’s font tools to render the font.  Microsoft Windows, Apple OS-X, iOS and Android all render fonts differently.  The simulator allows you to get it close, but you have to device test to get this working as necessary.

Rob

Hello Rob,

thanks for that.  That would explain my confusion.

Is there some way I can check to see where I am running so I can adjust my fonts accordingly?

Thanks!

Arthur

There is plenty of information you can determine about the device you are on. We did a tutorial a while back on device detection.  Perhaps you can pull what you need from there:

http://coronalabs.com/blog/2012/12/11/device-detection-on-steroids/

Rob

Hi Rob,

Thanks for all of that information and for getting back to me so quickly.  I’ve actually already implemented this in my code!!!

thanks again!

Arthur

Corona SDK accesses the operating system’s font tools to render the font.  Microsoft Windows, Apple OS-X, iOS and Android all render fonts differently.  The simulator allows you to get it close, but you have to device test to get this working as necessary.

Rob

Hello Rob,

thanks for that.  That would explain my confusion.

Is there some way I can check to see where I am running so I can adjust my fonts accordingly?

Thanks!

Arthur

There is plenty of information you can determine about the device you are on. We did a tutorial a while back on device detection.  Perhaps you can pull what you need from there:

http://coronalabs.com/blog/2012/12/11/device-detection-on-steroids/

Rob

Hi Rob,

Thanks for all of that information and for getting back to me so quickly.  I’ve actually already implemented this in my code!!!

thanks again!

Arthur