How to generalize custom font path in one place so that next time while adding new font we change only at one place



I am using below method to have a custom font. Now whenever i have to replace it with other font i have to change path everywhere in code. Is there any way to generalize path in one place ? Using it in string.xml won't work.



Typeface buttonfont = Typeface.createFromAsset(this.getAssets(), "fonts/omnesreg.ttf");
button.setTypeface(buttonfont);


Thanks in advance


No comments:

Post a Comment