All, another question about wrapping libraries with resources. This one has to do with fonts.
The library Im trying to wrap has the following code in it;
I get an error stating that it cant find the font file. The problem from what I can see is that the library Java code is expecting the font to be in the "fonts" sub-folder. I've tried altering the code to look in the root resources folder but that didnt work either.
In the end I altered the code to be this, which works;
This relies on B4A to create the font which is fine but I would like to remove the need for me to alter any code from the original library source code.
Is there a trick I need to know about loading the font correctly?
The library Im trying to wrap has the following code in it;
B4X:
Typeface t = Typeface.createFromAsset(c.getAssets(), String.format("fonts/%s.ttf", name));
I get an error stating that it cant find the font file. The problem from what I can see is that the library Java code is expecting the font to be in the "fonts" sub-folder. I've tried altering the code to look in the root resources folder but that didnt work either.
In the end I altered the code to be this, which works;
B4X:
Typeface t = Typeface.createFromAsset(BA.applicationContext.getAssets(), String.format("%s.ttf", name).toLowerCase(BA.cul));
This relies on B4A to create the font which is fine but I would like to remove the need for me to alter any code from the original library source code.
Is there a trick I need to know about loading the font correctly?