TextLayoutFormat Properties : Some work, some don't
I have been working with the TLF for the past week and a half. It started out quite rocky do to the various version differences. I tried, in Flex 3, the Beta 2 SDK (4.0.0.10485) and later builds to embed fonts with no success even with the ‘cff’ changed to ‘embedAsCFF’ the font swf would still fail to embed properly. I even tried the same process in Flash Builder 4 with no such luck.
I finally came to a working embed / loading scheme.
To embed fonts I am using Flex 3 with the Adobe MAX 2008 SDK (4.0.0.4021) with this method :
[Embed(source="fonts/AdobeHebrew-Regular.otf", mimeType="application/x-font", fontFamily="_AdobeHebrewEmbeddedFont", cff="true")]
public static var _AdobeHebrewEmbeddedFont:Class;
As for the TLF I have been using the swc included in the Adobe Flash Builder Plug-in Beta 2 build with great success. There are a few things that don’t seem to be working and I was wondering if I can get some input from other people that may be running into the same issues. Perhaps I should be using a newer version of the TLF like nightly builds?
This is pretty much just an output of all the methods I have tested in the TextLayoutFormat class. Some work some don’t. Maybe some are dependent on the other? Any insight would be greatly appreciated. Thanks in advance.
steve
//Layout format
var objLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
objLayoutFormat.direction = Direction.RTL; //works
//objLayoutFormat.paddingLeft = 15; //works
//objLayoutFormat.paddingTop = 15; //works
//objLayoutFormat.paddingRight = 15; //works
//objLayoutFormat.paddingBottom = 15; //works
//objLayoutFormat.textIndent = 2; //works
//objLayoutFormat.textDecoration = TextDecoration.NONE; //works
//objLayoutFormat.textRotation = TextRotation.ROTATE_180; //works
//objLayoutFormat.textAlign = TextAlign.CENTER; //works
//objLayoutFormat.textAlignLast = TextAlign.JUSTIFY; //nope
objLayoutFormat.textAlpha = 1; //works
objLayoutFormat.fontFamily = "_AdobeHebrewEmbeddedFont"; //works
objLayoutFormat.fontLookup = FontLookup.EMBEDDED_CFF; //works
objLayoutFormat.fontSize = 20; //works
objLayoutFormat.fontStyle = FontPosture.NORMAL; //works assuming the font supports it
objLayoutFormat.fontWeight = FontWeight.NORMAL; //works assuming the font supports it
objLayoutFormat.renderingMode = RenderingMode.CFF; //works
objLayoutFormat.cffHinting = CFFHinting.HORIZONTAL_STEM; //works
objLayoutFormat.color = 0xFFFFFF; //works
//objLayoutFormat.backgroundAlpha = 1; //nope
//objLayoutFormat.backgroundColor = 0x000000; //nope
//objLayoutFormat.paragraphStartIndent = 10; //works
//objLayoutFormat.paragraphEndIndent = 50; //works
//objLayoutFormat.paragraphSpaceBefore = 20; //nope
//objLayoutFormat.paragraphSpaceAfter = 100; //nope
//objLayoutFormat.justificationRule = JustificationRule.SPACE; //nope
//objLayoutFormat.breakOpportunity = BreakOpportunity.ANY; //works
//objLayoutFormat.kerning = Kerning.AUTO; //works assuming the font has the kerning table
//objLayoutFormat.trackingRight = 2; //works
//objLayoutFormat.trackingLeft = 2; //works
//objLayoutFormat.leadingModel = LeadingModel.AUTO; //works
//objLayoutFormat.whiteSpaceCollapse = WhiteSpaceCollapse.COLLAPSE; //nope
//objLayoutFormat.digitCase = DigitCase.DEFAULT; //works assuming the font has that ability
//objLayoutFormat.digitWidth = DigitWidth.TABULAR; //works
objLayoutFormat.ligatureLevel = LigatureLevel.COMMON;
objLayoutFormat.locale = "en";
//objLayoutFormat.typographicCase = TLFTypographicCase.LOWERCASE; //works
//objLayoutFormat.justificationStyle
//objLayoutFormat.textJustify
//objLayoutFormat.columnCount
//objLayoutFormat.columnGap = 60; //works
//objLayoutFormat.columnWidth = 40; //works
//objLayoutFormat.lineHeight = "80%"; //works
objLayoutFormat.lineBreak = LineBreak.TO_FIT; //works
//objLayoutFormat.lineThrough = true; //works
objLayoutFormat.blockProgression = BlockProgression.TB; //nope
//objLayoutFormat.verticalAlign = VerticalAlign.BOTTOM; //works
//objLayoutFormat.firstBaselineOffset = BaselineOffset.LINE_HEIGHT; //works
//objLayoutFormat.alignmentBaseline = TextBaseline.USE_DOMINANT_BASELINE; //works
//objLayoutFormat.dominantBaseline = TextBaseline.IDEOGRAPHIC_BOTTOM; //works
//objLayoutFormat.baselineShift = 20; //works
