logo
  • 教程列表
  • SO官方文档
  • 自定义字体
    • 画布文本中的自定义字体
    • 使用 Android O 中的字体
    • 自定义字体到整个活动
    • 在你的应用中添加自定义字体
    • 初始化字体
    • 在 TextView 中使用自定义字体
    • 通过 xml 在 TextView 上应用字体(不需要 Java 代码)
    • 高效的字体加载
  1. StackOverflow 文档
  2. Android 教程
  3. 自定义字体
  4. 画布文本中的自定义字体

画布文本中的自定义字体

Created: November-22, 2018

使用你的资产字体在画布中绘制文本。

Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/SomeFont.ttf");
Paint textPaint = new Paint();
textPaint.setTypeface(typeface);
canvas.drawText("Your text here", x, y, textPaint);
  • 使用 Android O 中的字体
  • 自定义字体

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明