Limit of text characters in corona

Hi,
Is there any limitation of displaying LongStrings in corona?
That means if we are displaying new text and the text is LongStrings. So it is neither displaying whole text nor giving any error?

Thanks,
Sabir [import]uid: 75428 topic_id: 33617 reply_id: 333617[/import]

There is a limit, but it’s hard to tell you what it is in character count. Text is rendered in an OpenGL texture and you have a max Texture size, which could be as little as 1024x1024, but more likely 2048x2048. Depending on the Font Size, your box width and height, it’s possible to exceed the maxTextureSize and that would cause the text to not render correctly.

Is this on a device or in the Simulator?
How much text are you talking about? What font and font size? What are your dimensions of your text box?

I’ll ask the team if there are other limits as well.
[import]uid: 199310 topic_id: 33617 reply_id: 133662[/import]

Yes, I am running on iPhone.
I am talking about more than 5000 characters and using native.systemFontBold, native.systemFont
font and the size of font is 14 or 15.
I am not using text box. [import]uid: 75428 topic_id: 33617 reply_id: 133679[/import]

If you are having your text wrap automatically, then there is a box. What is your display.newText call look like?

Without knowing your config.lua and your display.newText call, I can’t easily calculate how much texture memory it’s using but it’s probably over the texture size limit. [import]uid: 199310 topic_id: 33617 reply_id: 133763[/import]

I am writing the code which my display newText is calling.
local function positionText(text, y, colour, font, size)
local t = display.newText(text, 0, 0, display.contentWidth-80, 0, font, size)
t:setTextColor(colour[1],colour[2],colour[3]);
jobGroup:insert(t);
t:setReferencePoint(display.TopLeftReferencePoint);
t.x=30;
t.y=y;

return t.contentHeight;
end

y=y+positionText(“Job Number”, y, {89,182,245}, native.systemFontBold, 14);
y=10+y+positionText(jobData.id, y, {255,255,255}, native.systemFont, 15);

This code is running well on simulator as well as iPod but on iPhone5 it’s displaying error.
i.e: Blank white rectangle. [import]uid: 75428 topic_id: 33617 reply_id: 133822[/import]

That is certainly a symptom of the texture size being exceeded. Is the iPod an older non-retina display one?

You might want to find a way to break your text up into paragraphs and have multiple text objects spaced down the screen. [import]uid: 199310 topic_id: 33617 reply_id: 133844[/import]

There is a limit, but it’s hard to tell you what it is in character count. Text is rendered in an OpenGL texture and you have a max Texture size, which could be as little as 1024x1024, but more likely 2048x2048. Depending on the Font Size, your box width and height, it’s possible to exceed the maxTextureSize and that would cause the text to not render correctly.

Is this on a device or in the Simulator?
How much text are you talking about? What font and font size? What are your dimensions of your text box?

I’ll ask the team if there are other limits as well.
[import]uid: 199310 topic_id: 33617 reply_id: 133662[/import]

Yes, I am running on iPhone.
I am talking about more than 5000 characters and using native.systemFontBold, native.systemFont
font and the size of font is 14 or 15.
I am not using text box. [import]uid: 75428 topic_id: 33617 reply_id: 133679[/import]

Yes, I am using iPod non retina display with iOS version : 5.1.1. [import]uid: 75428 topic_id: 33617 reply_id: 133980[/import]

If you are having your text wrap automatically, then there is a box. What is your display.newText call look like?

Without knowing your config.lua and your display.newText call, I can’t easily calculate how much texture memory it’s using but it’s probably over the texture size limit. [import]uid: 199310 topic_id: 33617 reply_id: 133763[/import]

If I am writing below code then getting white box error. So I want to know the limitation of display.newText as well as limitation of memory which corona support?

[lua]local test = display.newText(“some odd random text to make a point An awesome app starts with an idea – but how do you turn your concept into a mobile reality? Today, we unveil the Corona SDK Tech Tutorials Center, the go-to spot for all of your technical needs, your “partner in crime” for app development, the “Robin to your Batman”… you get the idea!The Tech Tutorials Center is a collection of guides, sample projects, tips, tricks, and strategies covering a wide array of Corona topics. Whether you’re a newbie or a veteran, you’ll find proven app development methods, strategies, and time-tested solutions to the most frequently asked questions. We encourage you to explore and learn something new, or just brush up on your coding skills.”, 0,0, native.SystemFont, 200)
test.x = 768 / 2
test.y = 200

Thanks.
[import]uid: 75428 topic_id: 33617 reply_id: 134030[/import]

I am writing the code which my display newText is calling.
local function positionText(text, y, colour, font, size)
local t = display.newText(text, 0, 0, display.contentWidth-80, 0, font, size)
t:setTextColor(colour[1],colour[2],colour[3]);
jobGroup:insert(t);
t:setReferencePoint(display.TopLeftReferencePoint);
t.x=30;
t.y=y;

return t.contentHeight;
end

y=y+positionText(“Job Number”, y, {89,182,245}, native.systemFontBold, 14);
y=10+y+positionText(jobData.id, y, {255,255,255}, native.systemFont, 15);

This code is running well on simulator as well as iPod but on iPhone5 it’s displaying error.
i.e: Blank white rectangle. [import]uid: 75428 topic_id: 33617 reply_id: 133822[/import]

That is certainly a symptom of the texture size being exceeded. Is the iPod an older non-retina display one?

You might want to find a way to break your text up into paragraphs and have multiple text objects spaced down the screen. [import]uid: 199310 topic_id: 33617 reply_id: 133844[/import]

You can use system.getInfo(“maxTextureSize”) to get the limits for the device you’re on. The simulator is likely going to give you different results than the device since this is a operating system value.

Do you really want each character to be 200 points high?

A single line of text at 15 points high is going to be about 75,000 pixels wide for 5000 characters. That’s well past the texture Memory limit. I suspect you want that text to wrap some how right?

[import]uid: 199310 topic_id: 33617 reply_id: 134158[/import]

Thnks for reply Rob,
I dont want each character to be 200 points high.
I just want to show you that I’m getting this error when I’m fetching string data from server.
And my string length is too big and I’m using font size 14 or 15.

Thanks,
Sabir [import]uid: 75428 topic_id: 33617 reply_id: 134173[/import]

Yes, I am using iPod non retina display with iOS version : 5.1.1. [import]uid: 75428 topic_id: 33617 reply_id: 133980[/import]

If I am writing below code then getting white box error. So I want to know the limitation of display.newText as well as limitation of memory which corona support?

[lua]local test = display.newText(“some odd random text to make a point An awesome app starts with an idea – but how do you turn your concept into a mobile reality? Today, we unveil the Corona SDK Tech Tutorials Center, the go-to spot for all of your technical needs, your “partner in crime” for app development, the “Robin to your Batman”… you get the idea!The Tech Tutorials Center is a collection of guides, sample projects, tips, tricks, and strategies covering a wide array of Corona topics. Whether you’re a newbie or a veteran, you’ll find proven app development methods, strategies, and time-tested solutions to the most frequently asked questions. We encourage you to explore and learn something new, or just brush up on your coding skills.”, 0,0, native.SystemFont, 200)
test.x = 768 / 2
test.y = 200

Thanks.
[import]uid: 75428 topic_id: 33617 reply_id: 134030[/import]

You can use system.getInfo(“maxTextureSize”) to get the limits for the device you’re on. The simulator is likely going to give you different results than the device since this is a operating system value.

Do you really want each character to be 200 points high?

A single line of text at 15 points high is going to be about 75,000 pixels wide for 5000 characters. That’s well past the texture Memory limit. I suspect you want that text to wrap some how right?

[import]uid: 199310 topic_id: 33617 reply_id: 134158[/import]

Thnks for reply Rob,
I dont want each character to be 200 points high.
I just want to show you that I’m getting this error when I’m fetching string data from server.
And my string length is too big and I’m using font size 14 or 15.

Thanks,
Sabir [import]uid: 75428 topic_id: 33617 reply_id: 134173[/import]

Hi Rob,

Is there any update about this?

Thanks,