Blurred bitmap/embedded text when scrolling in TextField? (Flash/AS3)

匆匆过客 提交于 2019-12-11 02:15:13

问题


Basically, if I leave the text as-is, I get this:

As you can see, there is more text overflowing, so if I hit END on my keyboard, it does what TextField usually does and moves to the end with a little extra gap to show as such. Only, in this case the text is blurred:

Why is this happening?

Here is the embedded custom font:

[Embed(source = "../../../assets/font/FleftexYC_bold.ttf", 
    fontFamily      = "FleftexYC", 
    fontStyle       = "normal", // normal|italic
    fontWeight      = "bold",  // normal|bold
    unicodeRange    = "U+0020-007E,U+00A3", 
    embedAsCFF      = "false"
)]
private static const _FleftexYC_bold:Class;

And here is the actual TextField code:

this._textField = new TextField();
this._textField.defaultTextFormat = new TextFormat("FleftexYC", 8, 0x000000, true);
this._textField.embedFonts = true;
this._textField.height = 13;
this._textField.type = TextFieldType.INPUT;
this._textField.x = 9;
this._textField.y = 7;

Any thoughts?


回答1:


Try this:

_textField.antiAliasType=flash.text.AntiAliasType.ADVANCED;
_textField.gridFitType=flash.text.GridFitType.PIXEL;

The manual says this makes your text field align its display with pixel grid of the monitor, meaning that pressing "End" will not result in a blur anymore.



来源:https://stackoverflow.com/questions/17687207/blurred-bitmap-embedded-text-when-scrolling-in-textfield-flash-as3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!