0

I'm trying to add two fonts to my project: OpenSans-Semibold and OpenSans-Regular. But the names of these fonts contains capital letters which aren't supported at AS. I tried to rename one of this font and I didn't manage to do it. On the other hand I didn't rename these fonts and include them at me design but AS said that all font names can't have capital letters. And right now I don't know what to do because I would like to use these fonts from xml, not changing programmatically like this way:

TextView tx = (TextView)findViewById(R.id.textview1);
Typeface custom_font = Typeface.createFromAsset(getAssets(),  "fonts/abc.ttf");
tx.setTypeface(custom_font); 

I saw this and this questions, but I didn't find a solution of my problem. I tried to add my font files to special folders and then use them, but it didn't work anyway. Hope that my problem has the solution.

Zoe stands with Ukraine
  • 25,310
  • 18
  • 114
  • 149
Andrew
  • 1,695
  • 1
  • 15
  • 43

0 Answers0