📜  将自定义字体添加到 android 绘制对象 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:47.331000             🧑  作者: Mango

代码示例1
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);