Skip to main content
Known Participant
April 5, 2011
Question

FTETextField Anti-aliasing broken?

  • April 5, 2011
  • 2 replies
  • 3049 views

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-grid-fit-type-in-flex/), 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>

@11909012 s "library://ns.adobe.com/flex/spark";

@11909012 mx "library://ns.adobe.com/flex/mx";

@11220649-face

{

src: url("HELVETICA.TTF");

fontFamily: fntEmbededHelveticaCFF;

embedAsCFF: true;

}

@11220649-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>

This topic has been closed for replies.

2 replies

Adobe Employee
April 11, 2011

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.

Participating Frequently
April 12, 2011

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

JTtheGeekAuthor
Known Participant
April 5, 2011

This forums image recompression hides some of the details - here is the raw image: http://www.imagesocket.com/view/2011/04/05/badfterotationaliaspy4yy.png

http://is200.imagesocket.com/images/2011/04/05/badfterotationaliaspy4yy.png

JTtheGeekAuthor
Known Participant
April 6, 2011

wow Adobe, thanks for your amazing lack of a response..... par for the course

JTtheGeekAuthor
Known Participant
April 8, 2011

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!


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