Error using Text() on Android 4.4 Kitkat

  ... in the unlikely case you discovered a bug, post it here.

Error using Text() on Android 4.4 Kitkat

Postby Predator141 » Wed Nov 27, 2013 11:21 pm

Hello everyone,

I am using AndEngine for a long period of time now and it always meets the requirements I need.
My App is working on many devices and all major android version upon API level 8.

Now, for any reason, we are having trouble with users which have Android 4.4 running on their devices.

First of all, we load a font like this:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. FontFactory.setAssetBasePath("fnt/");
  2. final BitmapTextureAtlas blackFontTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
  3. blackFont = FontFactory.createFromAsset(activity.getFontManager(), blackFontTextureAtlas, activity.getAssets(), "font.ttf", 32, true, Color.BLACK);
  4. blackFont.load();
Parsed in 0.012 seconds, using GeSHi 1.0.8.4


Afterwards, we are attaching Text objects to the current scene like this:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. final Text myText = new Text(TEXT_POS_X, TEXT_POS_Y, sceneManager.getBlackFont(), activity.getString(R.string.myText), 20, textOptionsCenterAlignment, activity.getVertexBufferObjectManager());
  2. attachChild(newGameText);
Parsed in 0.012 seconds, using GeSHi 1.0.8.4


Actually there is no text displayed at all on Android 4.4.

Any ideas?

Thank you guys really much.
Greetings
Predator141
 
Posts: 2
Joined: Wed Nov 27, 2013 11:08 pm

Re: Error using Text() on Android 4.4 Kitkat

Postby Therdiday » Mon Jan 06, 2014 11:08 am

Hey Predator,

I don't know if you ever resolved this issue, but I too ran into this once my tablet was updated to 4.4. In my case, my typeface, created from an asset using the FontFactory class, went from a font size of 42 to something closer resembling 14. I haven't dug too deeply into the Typeface.createFromAsset() method, but if I replace it with an android default typeface then the font appears the correct size. Ex. Typeface.create(Typeface.DEFAULT, Typeface.NORMAL); In the future, I'll investigate deeper, but for the time being this will work.
Therdiday
 
Posts: 343
Joined: Thu Oct 20, 2011 11:12 pm

Re: Error using Text() on Android 4.4 Kitkat

Postby Predator141 » Tue Jan 07, 2014 1:56 am

Hey,

that's unbelievable! It really just was the typeface. Never thought about that...
I've tried everything else... I'm so sorry!

Thanks a lot!

Greetings
Predator141
 
Posts: 2
Joined: Wed Nov 27, 2013 11:08 pm


Return to Bugs

Who is online

Users browsing this forum: No registered users and 3 guests