Missing characters
Hi,
I got a problem with missing characters and the font Zapfino. If I use the font with a certain font size and capture the bitmapData of the text field the "f" character disappears. I'm working with the current Hero built, but it happened with earlier versions, too. It only happens if the font size is between 44 and 52. Here is the code of an test application:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
backgroundColor="#000000"
creationComplete="creationCompleteHandler(event)">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@font-face {
src: url("Zapfino.ttf");
fontFamily: "ZapfinoEmbedded";
embedAsCFF: true;
}
@font-face {
src: url("Zapfino.ttf");
fontFamily: "ZapfinoEmbedded";
fontWeight: bold;
embedAsCFF: true;
}
@font-face {
src: url("Zapfino.ttf");
fontFamily: "ZapfinoEmbedded";
fontStyle: italic;
embedAsCFF: true;
}
@font-face {
src: url("Zapfino.ttf");
fontFamily: "ZapfinoEmbedded";
fontStyle: italic;
fontWeight: bold;
embedAsCFF: true;
}
</fx:Style>
<fx:Script>
<![CDATA[
import flashx.textLayout.conversion.TextConverter;
import flashx.textLayout.elements.TextFlow;
import mx.events.FlexEvent;
import mx.graphics.ImageSnapshot;
private function creationCompleteHandler(event:FlexEvent):void {
var textFlowString:String = '<TextFlow whiteSpaceCollapse="preserve" version="2.0.0" xmlns="http://ns.adobe.com/textLayout/2008"><p clearFloats="none" direction="ltr" justificationRule="auto" justificationStyle="auto" leadingModel="auto" paragraphEndIndent="0" paragraphSpaceAfter="0" paragraphSpaceBefore="0" paragraphStartIndent="0" textAlign="left" textAlignLast="start" textIndent="0" textJustify="interWord" wordSpacing="100%,50%,150%"><span alignmentBaseline="useDominantBaseline" backgroundAlpha="1" backgroundColor="transparent" baselineShift="0" breakOpportunity="auto" cffHinting="horizontalStem" color="#ffffff" digitCase="default" digitWidth="default" dominantBaseline="auto" fontFamily="ZapfinoEmbedded" fontLookup="embeddedCFF" fontSize="48" fontStyle="normal" fontWeight="normal" kerning="auto" ligatureLevel="common" lineHeight="120%" lineThrough="false" locale="en" renderingMode="cff" textAlpha="1" textDecoration="none" textRotation="auto" trackingLeft="0" trackingRight="0" typographicCase="default">of af ff10</span></p></TextFlow>';
var textFlow:TextFlow = TextConverter.importToFlow(textFlowString, TextConverter.TEXT_LAYOUT_FORMAT);
text.textFlow = textFlow;
}
private function snapshotButton_clickHandler(event:MouseEvent):void {
var matrix:Matrix = new Matrix(4.921568627450981, 0, 0, 4.923076923076923);
var bitmapData:BitmapData = ImageSnapshot.captureBitmapData(text, matrix);
image.source = bitmapData;
}
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout/>
</s:layout>
<s:RichEditableText id="text"/>
<s:Button id="snapshotButton"
label="Make snapshot"
click="snapshotButton_clickHandler(event)"/>
<s:BitmapImage id="image"/>
</s:WindowedApplication>
