使用字体和字符串作为可绘制

编程入门 行业动态 更新时间:2024-10-23 05:43:08
本文介绍了使用字体和字符串作为可绘制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在简单的矢量图像在Android的精神,总是显得清晰,我想知道如果我不能使用字符串配对的自定义字体(或字符)为可绘制。

In the spirit of simple vector images on Android that always look sharp, I was wondering if I can't use custom font paired with a string (or a character) as a Drawable.

举例来说,如果我想用一个Webdings字符作为一个按钮可绘制,我会怎么做呢?

For instance, if I wanted to use a Webdings character as the drawable on a Button, how would I do this?

我要选择最好的字体大小(使用浸或 SP ),使我没有得到任何失真上的图像。

I want the best font size to be selected (using dip or sp) so that I get no distortion on the image.

你有什么想法,我怎样才能实现这一目标?

Do you have any ideas how I can accomplish this goal?

谢谢!

推荐答案

您可以检查出我的图书馆 IconicTextView 它允许使用几个标志性的字体来显示矢量图像。目前TextView中的一个子类是用来显示他们,但我正在重写它使用自定义绘制对象。这里的主要问题是选择最佳的字体大小,我试图找到一种方法来自动调整字体大小。

You can check out my library IconicTextView It allows to use several iconic fonts to display vector images. Currently a subclass of TextView is used to display them but I'm working on rewriting it to use custom Drawable. The main issue here is selecting the best font size, I'm trying to find a way to auto adjust font size.

更多推荐

使用字体和字符串作为可绘制

本文发布于:2023-11-26 18:27:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634687.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   字体

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!