Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

add custom font to android paint object

Typeface plain = Typeface.createFromAsset(assetManager, pathToFont); 
Typeface bold = Typeface.create(plain, Typeface.DEFAULT_BOLD)
Paint paint = new Paint();
paint.setTypeface(bold);
canvas.drawText("Sample text in bold",0,0,paint);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #custom #font #android #paint #object
ADD COMMENT
Topic
Name
1+3 =