是否可以使用前导和跟踪来设置 Android 字体样式?
Is it possible to have the followings in android font styling.
Leading (the space vertically between lines of text - name comes from the physical piece of lead that used to be used in mechanical printing process to separate lines of text).
Tracking (the horizontal space between each character).
If you have any ideas please share with me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过调用 TextView 的方法来更改行距
setLineSpacing()
或更改布局中 TextView 相应的 XML 属性(android:lineSpacingExtra
或android:lineSpacingMultiplier
)。< /p>正如此处的回答:< /p>
更新:自 API 21 起,有一个选项可以设置字偶距/字距/字母间距。您可以调用方法
setLetterSpacing()
或使用属性 letterSpacing< /a>.You can change leading by calling TextView's method
setLineSpacing()
or changing corresponding XML attributes of TextView in layout (android:lineSpacingExtra
orandroid:lineSpacingMultiplier
).As answered here:
Update: since API 21 there is an option to set kerning/tracking/letter spacing. You can call method
setLetterSpacing()
or set it in XML with attribute letterSpacing.对于跟踪,请查看这个答案。它对我来说效果很好。
For Tracking, check out this answer. It works fine for me.