play-co / devkit

HTML 5 game platform for browser and mobile
http://docs.gameclosure.com
623 stars 126 forks source link

font issue in native-android #208

Open jeeva1803 opened 9 years ago

jeeva1803 commented 9 years ago

Hi, i am facing an issue in font visibility, where i am getting perfect font visible in emulator. While taking build in android all fonts are disabled/not visible. While taking build using devkit debug native-android command i am getting build succeeded.... but still fonts are not visible in android mobiles......Don't know why it is happening. Please help me with this issue.

jwilm commented 9 years ago

Can you post your font config from manifest + font file?

jeeva1803 commented 9 years ago

Manifest file...

{ "appID": "6be31a2a09d54e4e9e5b3fe2b602b618", "dependencies": { "devkit-core": "https://github.com/gameclosure/devkit-core#", "devkit-facebook": "https://github.com/gameclosure/facebook#v2.0.0" }, "shortName": "wordfinder", "studio": { "name": "Lakeba", "domain": "wordfinder.lakeba.com", "stagingDomain": "wordfinder.lakeba.com" }, "supportedOrientations": [ "portrait" ], "title": "wordfinder", "addons": { "facebook": { "facebookAppID": "807615762613623", "facebookDisplayName": "Wordfinder" } }, "splash": { "autoHide": false }, "android":{ "facebookAppID": "807615762613623", "facebookDisplayName": "Wordfinder", "icons": { "36": "resources/icons/android36.png", "48": "resources/icons/android48.png", "72": "resources/icons/android72.png", "96": "resources/icons/android96.png" }, "versionCode": 1 }, "browser": { "facebookAppID": "807615762613623", "facebookDisplayName": "Wordfinder" } }

In eclipse logcat, I face the following errors when running the app through an android device.. ERROR console ERROR .log font helvetica is not supported. Did you forget to include it? 02-14 14:26:34.118: D/JS(17075): 14 Feb 14:26:34 ERROR console ERROR .log font bold arial is not supported. Did you forget to include it?

And I don't find any font config file, where i can find that?

collingreen commented 9 years ago

Are you using a custom font, or are you saying all your TextViews simply do not show up on native? If the latter, can you post a minimal reproduction Application.js file that showcases the issue so I can look into it?

thomaslsimpson commented 8 years ago

This didn't seem to get resolved, but I'm having the same issue. The complaint is:

D/JS      (10577): 6 Jan 20:45:41 ERROR console ERROR .log font 100 helvetica is not supported.  Did you forget to include it?

If you use 'Driod Sans' you just get the same thing only with 'droid sans' instead of 'helvetica' in the log.

I see the font appearing, but my positioning is off. I'm guessing the font metrics are not right because it is falling back to some other font? I could dig into it but I was hoping someone just new what was up. If not, point me in the right direction and I'll go fix it.

thomaslsimpson commented 8 years ago

Ok, so literally 30 seconds after I pasted that in there I realized that 'driod sans' was not 'droid sans' and therefore from my typo where I was forcing it to droid fonts when Android was detected.

So, it looks like the real issue is that the kit is trying to use Helvetica on Android. The device.defaultFontFamily is showing 'Helvetica' for a real Android device. When I use it, nothing positions properly. When I manually type 'Droid Sans' I get something better.

(Note: it is still off though because the vertical centering is wrong, but I'll figure that out I hope.)