e655. 混合风格的文本
文本 混合 风格
2023-09-14 09:12:00 时间
This example applies a new font and background color to a part of the text. You can apply styles to as many parts of the text as you need. See TextAttributes
for available styles.
// Apply styles to text AttributedString astr = new AttributedString("aString"); astr.addAttribute(TextAttribute.FONT, font, start, end); astr.addAttribute(TextAttribute.BACKGROUND, color, start, end); // Draw mixed-style text TextLayout tl = new TextLayout(astr.getIterator(), g2d.getFontRenderContext()); tl.draw(g2d, x, y);
Related Examples |
相关文章
- shell脚本--显示文本内容
- VB,Visual Basic如何修改代码文本大小和字体
- 文本检测和识别 代码结构梳理
- css ::selection 选择文本改变样式
- 文本字符串与 URL 编码的字符串间的转换
- C/C++基础讲解(四十八)之图形篇(渔网图案/沙丘图案/设置图形方式下的文本类型)
- Flutter TextField 文本输入框的基本属性及详解
- 简单Qt文本查找功能
- 华为云专家带你解读文本情感分析任务
- 【DL】第5章 以示例文本的样式生成文本
- 【NLP】第 3 章 处理原始文本
- littlevgl之lv_label设置长文本模式
- 16进制文本(如“0B 13 EF”)转16进制数据(如0x0B 0x13 0xEF)
- 多行或者单行文本超出显示点点点,如果保证内容始终垂直居中?
- 【期末考试】研究生英语视听说Vedio字幕文本内容
- 【Transformers】第 5 章:微调文本分类的语言模型