AS3 TextField AntiAliasType打破WordWrap [英] AS3 TextField AntiAliasType breaks WordWrap

查看:297
本文介绍了AS3 TextField AntiAliasType打破WordWrap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AS3中动态地创建和填充一个TextField。我已经嵌入了一些字体到我的库(使用Flash),并使用TextFormat设置文本字段的字体。由于TextField的宽度有限,我有 textfield.multiline = true; textfield.wordWrap = true; ,但是我注意到字体看起来有点像素化。 为了解决这个问题,我使用 textfield.antiAliasType = AntiAliasType.ADVANCED; 这使得文本看起来不错,但是停止工作的单词换行。其实看起来很奇怪,文本保持不变的TextField的宽度,然后把最后一个字在一个新的一行。

我需要做什么,使其看起来不错,包装? 典型的。询问一个问题,找到答案= / / / $ / B
$ B

指定一个网格拟合类型的TextField修复它。不知道为什么:
$ b

textfield.gridFitType = GridFitType.SUBPIXEL;



文档

lockquote>

将水平和垂直
行放在LCD
监视器的子像素网格上。 (红色,绿色和蓝色在LCD屏幕上的实际像素为
。)
对于
右对齐或居中对齐
动态文本通常是一个好的设置,对于动画和文本
质量,它有时是
有用的折衷。这个常量被用在
中,将
的gridFitType属性设置为TextField类。使用语法
GridFitType.SUBPIXEL。


I am dynamically creating and populating a TextField in AS3. I have embedded some fonts into my library (using Flash) and am setting the font of the text field using TextFormat. Because of the limited width of the TextField I have textfield.multiline = true; and textfield.wordWrap = true;, however I have noticed that the fonts look a little pixelated.

To fix this I am using textfield.antiAliasType = AntiAliasType.ADVANCED; which makes the text look nice, but stops the word-wrap from working. In fact it looks quite odd; The text keeps keeps going off the width of the TextField then puts the last word on a new line.

What do I need to do to make it look good and wrap?

解决方案

Typical. Ask a question, find the answer =/

Specifying a grid fit type to the TextField fixes it. Don't know why:

textfield.gridFitType = GridFitType.SUBPIXEL;

From the documentation:

Fits strong horizontal and vertical lines to the sub-pixel grid on LCD monitors. (Red, green, and blue are actual pixels on an LCD screen.) This is often a good setting for right-aligned or center-aligned dynamic text, and it is sometimes a useful tradeoff for animation vs. text quality. This constant is used in setting the gridFitType property of the TextField class. Use the syntax GridFitType.SUBPIXEL.

这篇关于AS3 TextField AntiAliasType打破WordWrap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆