I don’t use newRetinaText as it’s deprecated, but even when compiling with build 772, my text outputted with newText is tiny on the iPad 3, compared to the iPad 2 where it looked fine. Help please? I’m using the same font size and have dynamic scaling enabled (it’s a Universal app, set at 320x480 default size with letterbox mode), so it should scale dynamically, but apparently doesn’t… [import]uid: 10284 topic_id: 23819 reply_id: 323819[/import]
Had to double the font size even for iPad 2 now, with this build. Neither newText nor newRetinaText worked universally for me. I’m now using newText at twice the size than before (again, even on iPad 2), with an additional deviceIsRetina-check to double the font size once more on iPad 3.
In all of this, the simulator showed different results than the device, so all testing had to be done by loading the app on the device again. [import]uid: 10284 topic_id: 23819 reply_id: 95909[/import]
Getting different font results for iPhone 3 vs iPhone 4, too. The simulator won’t show accurately what will happen, so now I have to debug on 4 devices and manually adjust font size by reading out device parameters… for iPad 2, iPad 3, iPhone 3, and iPhone 4.
Hope to see a fix, thanks Corona! [import]uid: 10284 topic_id: 23819 reply_id: 96063[/import]
Here’s the hotfix that works for me on all 4 devices, using newText (not newRetinaText):
[code]-- In the sprite wrapper:
function self:setFontSize(fontSize)
self.size = fontSize * appGetScaleFactor()
end
– … and elsewhere:
function appGetScaleFactor()
local deviceWidth = ( display.contentWidth - (display.screenOriginX * 2) ) / display.contentScaleX
return math.floor(deviceWidth / display.contentWidth)
end[/code]
Update: Though mind you, this only works for a Universal app. If it’s an iPad only app, you need to adjust again. [import]uid: 10284 topic_id: 23819 reply_id: 96066[/import]
Hey Philipp, we’re aware of some issues here and we’re working on it.
Thanks for the follow up with the workaround you’re currently using
Peach [import]uid: 52491 topic_id: 23819 reply_id: 96255[/import]
I am also fighting the text size thing. With build 767, i am still able to use retina text, right? whats the downside of using it? croppy font on the new ipad, or what’s the issue?
thanks! [import]uid: 90610 topic_id: 23819 reply_id: 96262[/import]
From my initial testing with the “new and improved” newText() function, text is displayed correctly in the Xcode simulator in all modes, and also on all devices iPhone, iPhone Retina, iPad.
However, I don’t have a new iPad yet so I can’t speak for the real iPad Retina display.
In the absence of a new iPad I assumed that I could trust the Xcode simulator, where everything looks OK when I do my testing.
Does this mean that we can’t trust the Xcode Simulator even if it looks OK in Pad retina mode?
[import]uid: 70847 topic_id: 23819 reply_id: 96265[/import]
Has the “stable” build (2011.704) been updated to work with the new iPad? I’m having other issues when moving to the newest daily build.
Thanks! [import]uid: 129205 topic_id: 23819 reply_id: 96567[/import]
I noticed that I only get this problem with using certain fonts. When fonts are designed they are designed at a certain size. Sometimes if you are using a special font, say, one from dafont.com or similar, you will get a font that does not scale the same as one found in the system. Try changing fonts and see if that fixes the issue, if it does then you might have to compensate for the font’s scale. [import]uid: 63800 topic_id: 23819 reply_id: 96579[/import]
@dingo - Retina text had a few “quirks”, there are some threads discussing various issues users had encountered and requests for a change.
@interAlia - Yes, 704 from the daily builds page should work with the new iPad.
@Mike - we have a thread on some custom fonts having issues with scaling, it has been filed as a bug. [import]uid: 52491 topic_id: 23819 reply_id: 96805[/import]
What about the Xcode simulator (Retina mode) vs. the new iPad?
Are there any noted differences between the Xcode 5.1 simulator (retina mode) and a real Retina iPad? [import]uid: 70847 topic_id: 23819 reply_id: 96806[/import]
Hey Ingemar - I’m afraid I can’t actually answer that one as I don’t have access to an iPad/new iPad currently.
To the best of my knowledge there are no noted differences between the Xcode simulator and the device itself however as is always the case it’s strongly recommended you also test on device before publishing. [import]uid: 52491 topic_id: 23819 reply_id: 96830[/import]
OK, thanks.
I have all other devices for testing, and my apps are running with no problems, and the Xcode simulator (retina mode) is also behaving as expected.
So, I’m going to have to trust the Xcode simulator this time around, as it’s not possible to buy the new iPad here in Korea yet… hopefully soon!
[import]uid: 70847 topic_id: 23819 reply_id: 96833[/import]
@Ingemar: which build are you using? So is it enough to just replace newRetinaText with newText?
thanks! [import]uid: 90610 topic_id: 23819 reply_id: 96835[/import]
I never used newRetinaText() myself because of its limitations. I wrote my own routine that scaled depending on device, and I just replaced my function with display.newText() and it worked across all devices iPhone, iPad and Android…
But from what I can tell you should be able to do the same with newRetinaText().
I’m using the latest build 2012.775 right now.
EDIT:
FWIW I only use native.systemFont and native.systemFontBold so maybe that’s why I don’t see any problems with scaling in the Xcode simulator… [import]uid: 70847 topic_id: 23819 reply_id: 96836[/import]
@ingemar: cool, thanks, I guess I am fine then! [import]uid: 90610 topic_id: 23819 reply_id: 96837[/import]
The problem is that the new newText function creates a text object whose .size method returns the scaled up text size instead of the size in regards to the content width and height as defined in the config.lua file.
E.g.:
[lua]local t = display.newText(“Testing…”, 0, 0, “SomeFontName”, 20)
print(t.size)
– returns:
– 20 on iPhone
– 40 on iPhone4
– 48 on iPad
– 96 on New iPad[/lua]
It should return 20 on all devices. [import]uid: 61899 topic_id: 23819 reply_id: 97126[/import]
I can’t believe this isn’t solved yet. I just spent a whole day to discover… it ain’t my fault! And my app is very text heavy — so this is killing me on the iPad 3.
**** update:
I was using retina-text-fix.lua, code that was recommended to fix some other problem. THAT was resizing the text too big. The question is, what will happen now that I’ve removed retina-text-fix.lua??? [import]uid: 37366 topic_id: 23819 reply_id: 98633[/import]
If you want to get the actual size you can do the following:
[lua]local t = display.newText(“Testing…”, 20, 20, native.systemFont, 20)
local round = function(num, idp)
local mult = 10 ^ (idp or 0);
return math.floor(num * mult + 0.5) / mult;
end
local getFontSize = function(object)
return round(object.size * display.contentScaleX);
end
print(getFontSize(t));
– returns:
– 20 on all devices[/lua]
The good thing about wrapping the above in a function is that if Ansca ever decide to change the behavior of the .size property all your code won’t break. You just have to change one line of code in the function above and you’re all set again. [import]uid: 70847 topic_id: 23819 reply_id: 98676[/import]
I would like to jump in here with a couple things.
-
Build 704B (currently only a Daily Build release) has been updated to fix the new iPad Retina scaling problem but doesn’t contain any of the new features implemented since 704. (E.g., it doesn’t have the display.newText fix that supports retina displays).
-
As far as we can tell, the Xcode IOS 5.1 Simulator does match what you see on the new iPad Retina device.
-
If you are using the latest daily build that adds retina support to display.newText, you need to be careful if you have other code that tries to scale up the text for retina support. Scaling the text more than once will increase the amount of texture memory used and either cause low memory problems or display black rectangles because the text object has exceeded the texture memory limit of the device.
If you are having text problems, look at any library code that you have that may be trying to add retina support and remove it.
If you are still having problems, please submit a bug report with a short sample project that demonstrates the issue. You may want to try some of the Corona sample apps to see if they show any of the text problems. [import]uid: 7559 topic_id: 23819 reply_id: 98789[/import]