Where is the system.resourceDirectory located?
The system.resource directory is where your code and resources live. It is, wherever the device puts your code. Are you asking because you want to access it via an external tool? I don’t think you can unless you’ve rooted your device.
Well I have uploaded 4 apps to android with the font in the folder with all my code and the fonts do not work on android.
Max,
Fonts can be tricky. Did you test these on your own Android device and find that they worked?
It can be hard to get the names right, so try this.
- Get my Font Dumper ($1) or RG Super Meter ($20) from my site: http://roaminggamer.com/makegames/
2a. For the font dumper, include your font in the same folder and the sample, install it on your device, and page through till you see the correct font name. (May need to set the compatibility flag as this is an old utility.)
2b. For RG Super Meter, drop it in one of your trouble games (just a few lines of code to run). Install the game on your device and run it. Then, when RG Super meter pops up, go to the info page/ fonts tab and find your font name. Use this name (exactly) for your font internally.
Alternately, you can use the code here to dump all the fonts discovered by your app: http://docs.coronalabs.com/daily/api/library/native/getFontNames.html
local g = display.newGroup() local fonts = native.getFontNames() local count, found\_count = 0,0 for i,fontname in ipairs( fonts ) do count = count+1 j, k = string.find( fontname, "Times" ) if ( j ~= nil ) then found\_count = found\_count + 1 print( "found font: " .. fontname ) local obj = display.newText( fontname, 40, 40 + (found\_count - 1) \* 40, fontname, 24 ) obj.anchorX = 0 g:insert( obj ) end end print( "Font count: " .. count )
Finally, be aware that font names in the simulator may not be the same as on the device and that not all fonts work on the device.
The system.resource directory is where your code and resources live. It is, wherever the device puts your code. Are you asking because you want to access it via an external tool? I don’t think you can unless you’ve rooted your device.
Well I have uploaded 4 apps to android with the font in the folder with all my code and the fonts do not work on android.
Max,
Fonts can be tricky. Did you test these on your own Android device and find that they worked?
It can be hard to get the names right, so try this.
- Get my Font Dumper ($1) or RG Super Meter ($20) from my site: http://roaminggamer.com/makegames/
2a. For the font dumper, include your font in the same folder and the sample, install it on your device, and page through till you see the correct font name. (May need to set the compatibility flag as this is an old utility.)
2b. For RG Super Meter, drop it in one of your trouble games (just a few lines of code to run). Install the game on your device and run it. Then, when RG Super meter pops up, go to the info page/ fonts tab and find your font name. Use this name (exactly) for your font internally.
Alternately, you can use the code here to dump all the fonts discovered by your app: http://docs.coronalabs.com/daily/api/library/native/getFontNames.html
local g = display.newGroup() local fonts = native.getFontNames() local count, found\_count = 0,0 for i,fontname in ipairs( fonts ) do count = count+1 j, k = string.find( fontname, "Times" ) if ( j ~= nil ) then found\_count = found\_count + 1 print( "found font: " .. fontname ) local obj = display.newText( fontname, 40, 40 + (found\_count - 1) \* 40, fontname, 24 ) obj.anchorX = 0 g:insert( obj ) end end print( "Font count: " .. count )
Finally, be aware that font names in the simulator may not be the same as on the device and that not all fonts work on the device.