I hit my head by setting custom fonts to text from code from one hour. I already did this in my previous project and it worked!
But I don’t know for what reason, this gives me the exhaustion of “native font cannot be created” here. I looked at a lot of SO questions related to this, and tried to come up with a solution and worked on those cases. But none of them work for me. :(
I deleted and updated the assests folder, and also tried with another font.ttf file in accordance with the answers to a question related to the same problems. I also cleaned and rebuilt the project, but all efforts were in vain!
Please help me! I would be grateful for your help.
The code I use to install fonts:
I have my GOTHIC.TTF fonts in the resource folder:
... Typeface font=Typeface.createFromAsset(getAssets(), "fonts/GOTHIC.TTF"); title.setTypeface(font); ...
EDIT:
I think I was mistaken by writing "fonts / GOTHIC.TTF", where when I inserted fonts directly into assets, and not into assets / fonts. But to do this "GOTHIC.TTF" also does not solve the problem. Where can I go wrong ?!
Hiral source share