Flash AS3,文本抗锯齿是由代码控制的吗?
文本抗锯齿是由代码控制的,还是嵌入的?我想要做的是获取别人制作的 swf 文件,找到 swf 文件中的所有文本,并将所有抗锯齿模式从动画更改为可读。在as3中也是这样吗?老实说,我还没有在代码中尝试过任何抗锯齿功能。
Is text anti-aliasing controlled by code, or is it embedded? What I want to do is take a swf file that someone else has made, find all of the text in the swf file and change all of the anti-aliasing modes from animation to readability. Does it work that way in as3? I honestly haven't tried any anti-aliasing in code yet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将文本字段的 antiAliasType 设置为“高级”,这样您就可以对清晰度和厚度进行精细控制。但是,必须嵌入字体(包括:文本字段必须将 embedFonts 设置为 true,TextFormat 对象的字体属性必须与嵌入字体的 fontName 完全相同,并且字体必须已编译)。所以从技术上来说“这可能吗?” - 是的。它有可能按照你想要的方式工作吗?不,除非您打算使用您知道已经使用嵌入字体的 swiff。那么您需要从加载的 swiff 中获取所有文本字段(您可以使用如下内容: http:// upshots.org/?p=107,然后使用 array.filter 只返回 TextField 对象),然后应用您的逻辑。
编辑:添加代码示例
刚刚运行了快速测试 - 按描述工作。
you can set the antiAliasType of a textfield to 'advanced', which gives you fine control over sharpness and thickness. however, the fonts must be embedded (inclusive: the textfield must have embedFonts set to true, the TextFormat objects must have font properties exactly equal to the fontName of the embedded font, and the fonts must be already compiled). so technically 'is it possible?' - yes. is it likely to work the way you want it to? no, unless you plan on working with a swiff that you know is using embedded fonts already. then you'll need to grab all the textfields from the loaded swiff (you could use something like this: http://upshots.org/?p=107, then use array.filter to get back only TextField objects), then apply your logic.
EDIT: adding code sample
just ran a quick test - works as described.