FTETextField Anti-aliasing broken?
Copy link to clipboard
Copied
Cross Posted at: http://forums.adobe.com/message/3595873#3595873
Robin I am using FTETextField, using rotation, and using cff embeded fonts which is verified by FlexGlobals.topLevelApplication.SystemManager.IsFontEmbeded(objFontFo rmat) - which returns true...
However, the text looks like crap when rotated. We were able to solve this in our previous iterations via sharpness and thinkness on advanced Anti-Alias settings ( see:http://blog.flexexamples.com/2007/10/24/setting-a-fonts-anti-alias-typ e-sharpness-thickness-and-gri...), but now we are trying to make all our charting components multi-lingual (http://www.Dedoose.com) and thus using FTE.
These options were on UITextFormat, but are no longer available in the FTE components as far as all the sleuthing I've done.
I have a simple demo app with a mx label, spark label, and FTETextField. T
he mx label using a nonCFF embeded font, the spark and FTE using the same cff embeded font.
The mx I can control the sharpness and thickness and looks great!
The spark label looks okay, it's at least anti-aliasing properly though I would like to control the font thickness a little better.
The FTEText field is a disaster: It is supposedly using the exact same FTE engine and font as the spark label but looks like crap when rotated. If you decrease the font size it gets far worse.
Please please help, the spark label is not an option as this is for a sprite based charting engine per raw performance is mission critical.
Here is the code and an screenshot:
Code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" initialize="OnInit(event)">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@Blissful_help0D4E-face
{
src: url("HELVETICA.TTF");
fontFamily: fntEmbededHelveticaCFF;
embedAsCFF: true;
}
@Blissful_help0D4E-face
{
src: url("HELVETICA.TTF");
fontFamily: fntEmbededHelveticaNotCFF;
embedAsCFF: false;
}
</fx:Style>
<fx:Script>
<![CDATA[
import mx.core.FTETextField;
import mx.core.FlexGlobals;
protected var _txtFTE:FTETextField;
protected var _objRotTimer:Timer;
protected function OnInit(objEvent:Event):void
{
var objFormat:TextFormat = new TextFormat("fntEmbededHelveticaCFF", 12);
_txtFTE = new FTETextField();
_txtFTE.embedFonts = true;
_txtFTE.text = "Testing FTE";
_txtFTE.setTextFormat(objFormat);
ucFTEHolder.addChild(_txtFTE);
lblEmbeded.text = "IsFontEmbeded: " + FlexGlobals.topLevelApplication.systemManager.isFontFaceEmbedded(objFormat);
_objRotTimer = new Timer(50);
_objRotTimer.addEventListener(TimerEvent.TIMER, OnRotTimerTick);
_objRotTimer.start();
}
protected function OnRotTimerTick(objEvent:Event):void
{
_txtFTE.x = (ucFTEHolder.width - _txtFTE.width) * .5;
_txtFTE.y = (ucFTEHolder.height- _txtFTE.height) * .5;
_txtFTE.rotation += 1;
_lblSpark.rotation += 1;
_lblMX.rotation +=1;
}
]]>
</fx:Script>
<s:VGroup width="100%" height="100%" paddingLeft="5" paddingRight="5" paddingTop="5" paddingBottom="5">
<s:Label id="lblEmbeded"/>
<s:HGroup width="100%" height="100%">
<s:Group id="grpMXLabel" width="100%" height="100%">
<mx:Label id="_lblMX" text="Texting MX" fontFamily="fntEmbededHelveticaNotCFF" fontSharpness="-50" fontThickness="120" fontSize="12" horizontalCenter="0" verticalCenter="0"/>
</s:Group>
<s:Group width="100%" height="100%">
<s:Label id="_lblSpark" text="Testing Spark" fontFamily="fntEmbededHelveticaCFF" horizontalCenter="0" verticalCenter="0" fontSize="12"/>
</s:Group>
<mx:UIComponent id="ucFTEHolder" width="100%" height="100%"/>
</s:HGroup>
</s:VGroup>
</s:Application>
Copy link to clipboard
Copied
This forums image recompression hides some of the details - here is the raw image: http://www.imagesocket.com/view/2011/04/05/badfterotationaliaspy4yy.png
Copy link to clipboard
Copied
wow Adobe, thanks for your amazing lack of a response..... par for the course

Copy link to clipboard
Copied
We have started taking a look at your code (thanks for providing it) but don't yet have anything we can tell you about the problem.
Copy link to clipboard
Copied
Thank you for acklodging that someone here is actually looking, that's all I was hoping for at the momment. I understand it will obviously take time to figure out the issue and wether or not this is a bug or me being an idiot. Thank you!
Copy link to clipboard
Copied
So is their something else I can do here to assist? You want me to email the project to you guys or something? What can I do to speed this discovery up as this is a fairly serious issue for my team at the momment.
~ JT
Copy link to clipboard
Copied
Hi JT:
I think the information you offered is quite enough.
Actually, we are working on this issue. The font setting things are not a easy task. We are trying to isolate where the problem is. Please trust us. We've tried our best. We'll reply to you as soon as we got any progress.
Thanks
Copy link to clipboard
Copied
Thanks Gang, let me know if I can assist further, but yeah confused as heck how it would work in Spark Label and not FTETextField...
Copy link to clipboard
Copied
Hi,
Your font is not a free one, so I cannot get it. I use your source code with a common font *Arial.ttf* and change its filename.
The result is as follows (compiling with Flex SDK 4.5 embeded in FB 4.5 premium).
It seems good for Arial. So pls send me your TTF file to let me reproduce your result.
Copy link to clipboard
Copied
Hi Jk
I cannot reproduce the issue on my platform with Vellum 2.0 and Flex SDK 4.0 too. Can you send us which Vellum and which Flex SDK you are using? Thanks
One more thing you may do for us is to trace all the fonts settings using the following codes to replace the line of lblEmbeded.text = "IsFontEmbeded: " + FlexGlobals.topLevelApplication.systemManager.isFontFaceEmbedded(objFormat); and sent the results to us.
var fontArray:Array = Font.enumerateFonts(true);
lblEmbeded.text += "Fonts: \n";
for(var i:int = 0; i < fontArray.length; i++) {
var thisFont:Font = fontArray;
lblEmbeded.text += "FONT " + i + ":: name: " + thisFont.fontName + "; typeface: " +
thisFont.fontStyle + "; type: " + thisFont.fontType;
if (thisFont.fontType == "embeddedCFF"||thisFont.fontType == "embedded") {
lblEmbeded.text += "*";
}
lblEmbeded.text += "\n";
}
Thanks
