I just exported an app to an android device (not player) that uses this and it seems to work as usual. I will do some more tests in a bit after I finish some other tests.
chipster123 uh.. yes I also got the error "arial.ttf: Error while reading font file." I'll update this thread when I found something about this bug. (And as you said, on desktop player it works)
@atilim thanks for confirming. Also, there is a difference between how the same TTF font is rendered on the player vs the .apk build running on my device. Here is a picture showing the differences. Could this be related?
Notice how the fonts have different positioning and extend differently. Also, the relative text spacing is exactly the same as shown here whether in 'pixel-perfect' or 'stretch' mode
I've got an app that displays OK in the player on my laptop but throws the error 'GOTHIC.TTF: Error while reading font file.' when I try playing it in the (updated) player on my phone. I've double checked to make sure that the font file is included in my project, which it is. (Edit: Oops - just seen that @atilim has already said this!)
When I build the apk and run it, all double digit numbers that are positioned using a getWidth()/2 bit of coding to centre them only show the tens digit of the number and not the units. The tens digit appears to be centred.
When I build exactly the same app using the previous version of Gideros, it works fine in the player on the computer and on the phone and the apk is also OK.
I've fixed the first bug. It only occurs on android player. Most probably I'll fix the second one today (getWidth() of TextField) and release a new package (2012.2.2.2 ) that only addresses these two bugs.
Thanks @atilim. Just in case I wasn't clear, I only had the problem with getWidth() of a text field when I built the apk - the double digit numbers looked OK in the player on my computer.
@ar2rsawseen If I can, this will be the first "bugfix only" version
@petec, @chipster123 no matter how hard I tried, I couldn't make a difference between desktop player, android player and exported apk. @petec, what is the exact string that causes the problem? And that would be great if you can send me (atilim@g...com) a simple example that shows the problem.
@atilim, I'm just about to send you an example that causes me the problem ...but I've just found that I only get this problem when I install it on my ZTE Blade (Arm6) and it works fine on a Nexus One and Archos 80 tablet.
@atilim, I also found one ttf problem. I use calculated x, y for TextField:setPosition(x, y) and some times TextField is distorted in the screen (at win-player and at device). It happens then x coordinate in not integer.
I've just been able to try things on an Archos 70 and that shows the same problem as the ZTE Blade where only the tens digit of two digit numbers show. Just mentioning in case there is anything about that tabet and the Blade that give a clue.
@atilim, I also found one ttf problem. I use calculated x, y for TextField:setPosition(x, y) and some times TextField is distorted in the screen (at win-player and at device). It happens then x coordinate in not integer.
Yea I noticed this before too I think, atilim was going to add filtering to the TTFont so you could use anti aliasing on it. I'm not sure if it's a Gideros problem or just a side effect of scaling the screen and not having an exact position to place the font. Either way using math.floor or a filtered bitmap font works.
Comments
Does it just not display in the player for you?
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Notice how the fonts have different positioning and extend differently.
Also, the relative text spacing is exactly the same as shown here whether in 'pixel-perfect' or 'stretch' mode
I've got an app that displays OK in the player on my laptop but throws the error 'GOTHIC.TTF: Error while reading font file.' when I try playing it in the (updated) player on my phone. I've double checked to make sure that the font file is included in my project, which it is. (Edit: Oops - just seen that @atilim has already said this!)
When I build the apk and run it, all double digit numbers that are positioned using a getWidth()/2 bit of coding to centre them only show the tens digit of the number and not the units. The tens digit appears to be centred.
When I build exactly the same app using the previous version of Gideros, it works fine in the player on the computer and on the phone and the apk is also OK.
Thanks, Pete
I've fixed the first bug. It only occurs on android player. Most probably I'll fix the second one today (getWidth() of TextField) and release a new package (2012.2.2.2 ) that only addresses these two bugs.
@petec, @chipster123 no matter how hard I tried, I couldn't make a difference between desktop player, android player and exported apk. @petec, what is the exact string that causes the problem? And that would be great if you can send me (atilim@g...com) a simple example that shows the problem.
Example:
http://www.giderosmobile.com/forum/discussion/798/font-questions#Item_3