You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ha...@apache.org on 2017/03/16 13:37:31 UTC

[11/42] flex-asjs git commit: And here’s TLF…

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/NumberLineFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/NumberLineFactory.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/NumberLineFactory.as
new file mode 100644
index 0000000..42fc134
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/NumberLineFactory.as
@@ -0,0 +1,138 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.factory
+{
+	import org.apache.flex.textLayout.compose.utils.FactoryHelper;
+	import org.apache.flex.geom.Rectangle;
+	import org.apache.flex.text.engine.ITextBlock;
+	import org.apache.flex.text.engine.ITextLine;
+	import org.apache.flex.textLayout.compose.utils.NumberLineUserData;
+	import org.apache.flex.textLayout.debug.Debugging;
+	import org.apache.flex.textLayout.elements.IBackgroundManager;
+	import org.apache.flex.textLayout.elements.ITextFlow;
+	import org.apache.flex.textLayout.formats.BlockProgression;
+	import org.apache.flex.textLayout.formats.ITextLayoutFormat;
+
+	public class NumberLineFactory extends StringTextLineFactory implements INumberLineFactory
+	{
+		private var _listStylePosition:String;
+		private var _markerFormat:ITextLayoutFormat;
+		private var _backgroundManager:IBackgroundManager;
+
+		public function get listStylePosition():String
+		{
+			return _listStylePosition;
+		}
+
+		public function set listStylePosition(val:String):void
+		{
+			_listStylePosition = val;
+		}
+
+		public function get markerFormat():ITextLayoutFormat
+		{
+			return _markerFormat;
+		}
+
+		public function set markerFormat(val:ITextLayoutFormat):void
+		{
+			_markerFormat = val;
+			spanFormat = val;
+		}
+
+		public function get backgroundManager():IBackgroundManager
+		{
+			return _backgroundManager;
+		}
+
+		public function clearBackgroundManager():void
+		{
+			_backgroundManager = null;
+		}
+
+		/** @private */
+		static public function calculateInsideNumberLineWidth(numberLine:ITextLine, bp:String):Number
+		{
+			var minVal:Number = Number.MAX_VALUE;
+			var maxVal:Number = Number.MIN_VALUE;
+			var idx:int = 0;
+			var rect:Rectangle;
+
+			if (bp == BlockProgression.TB)
+			{
+				for (; idx < numberLine.atomCount; idx++)
+				{
+					// trace(idx,numberLine.getAtomTextBlockBeginIndex(idx),numberLine.getAtomBounds(idx));
+					if (numberLine.getAtomTextBlockBeginIndex(idx) != numberLine.rawTextLength - 1)
+					{
+						rect = numberLine.getAtomBounds(idx);
+						minVal = Math.min(minVal, rect.x);
+						maxVal = Math.max(maxVal, rect.right);
+					}
+				}
+			}
+			else
+			{
+				for (; idx < numberLine.atomCount; idx++)
+				{
+					// trace(idx,numberLine.getAtomTextBlockBeginIndex(idx),numberLine.getAtomBounds(idx));
+					if (numberLine.getAtomTextBlockBeginIndex(idx) != numberLine.rawTextLength - 1)
+					{
+						rect = numberLine.getAtomBounds(idx);
+						minVal = Math.min(minVal, rect.top);
+						maxVal = Math.max(maxVal, rect.bottom);
+					}
+				}
+			}
+			// numberLine.flushAtomData(); // Warning: Now does nothing
+			// trace("textWidth",numberLine.textWidth,maxVal-minVal);
+			return maxVal > minVal ? maxVal - minVal : 0;
+		}
+
+		protected override function callbackWithTextLines(callback:Function, delx:Number, dely:Number):void
+		{
+			for each (var textLine:ITextLine in FactoryHelper.staticComposer.lines)
+			{
+				textLine.userData = new NumberLineUserData(listStylePosition, calculateInsideNumberLineWidth(textLine, textFlowFormat.blockProgression), _markerFormat, paragraphFormat.direction);
+				var textBlock:ITextBlock = textLine.textBlock;
+				if (textBlock)
+				{
+					CONFIG::debug
+					{
+						Debugging.traceFTECall(null, textBlock, "releaseLines", textBlock.firstLine, textBlock.lastLine); }
+					textBlock.releaseLines(textBlock.firstLine, textBlock.lastLine);
+				}
+				textLine.x += delx;
+				textLine.y += dely;
+				textLine.validity = "static";
+				CONFIG::debug
+				{
+					Debugging.traceFTEAssign(textLine, "validity", "static"); }
+				callback(textLine);
+			}
+		}
+
+		// save the backgroundManager for later use.  generate the background when the ITextLine is placed
+		public override function processBackgroundColors(textFlow:ITextFlow, callback:Function, x:Number, y:Number, constrainWidth:Number, constrainHeight:Number):*
+		{
+			_backgroundManager = textFlow.backgroundManager;
+			textFlow.clearBackgroundManager();
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/StandardTLFFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/StandardTLFFactory.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/StandardTLFFactory.as
new file mode 100644
index 0000000..2277f85
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/StandardTLFFactory.as
@@ -0,0 +1,48 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.factory {
+	import org.apache.flex.svg.GraphicContainer;
+	import org.apache.flex.core.IParentIUIBase;
+	import org.apache.flex.svg.Rect;
+	import org.apache.flex.svg.CompoundGraphic;
+	import org.apache.flex.textLayout.factory.ITLFFactory;
+	import org.apache.flex.graphics.ICompoundGraphic;
+	import org.apache.flex.graphics.IRect;
+	import org.apache.flex.text.engine.ITextFactory;
+
+	public class StandardTLFFactory implements ITLFFactory {
+		public function getRect() : IRect {
+			return new Rect();
+		}
+
+		public function getCompoundGraphic() : ICompoundGraphic {
+			return new CompoundGraphic();
+		}
+		
+		public function getContainer():IParentIUIBase
+		{
+			return new GraphicContainer();
+		}
+//TODO add a basic factory when it's ready		
+		private static var factory:ITextFactory;
+		public function get textFactory() : ITextFactory {
+			return factory;
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/StringTextLineFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/StringTextLineFactory.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/StringTextLineFactory.as
new file mode 100644
index 0000000..21efec2
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/StringTextLineFactory.as
@@ -0,0 +1,469 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.factory
+{
+	import org.apache.flex.geom.Rectangle;
+	import org.apache.flex.text.engine.ITextLine;
+	import org.apache.flex.textLayout.compose.ISimpleCompose;
+	import org.apache.flex.textLayout.compose.utils.ContextUtil;
+	import org.apache.flex.textLayout.compose.utils.FactoryHelper;
+	import org.apache.flex.textLayout.container.ScrollPolicy;
+	import org.apache.flex.textLayout.debug.assert;
+	import org.apache.flex.textLayout.elements.Configuration;
+	import org.apache.flex.textLayout.elements.IConfiguration;
+	import org.apache.flex.textLayout.elements.ParagraphElement;
+	import org.apache.flex.textLayout.elements.SpanElement;
+	import org.apache.flex.textLayout.elements.TextFlow;
+	import org.apache.flex.textLayout.formats.BlockProgression;
+	import org.apache.flex.textLayout.formats.ITextLayoutFormat;
+	import org.apache.flex.textLayout.formats.LineBreak;
+	import org.apache.flex.textLayout.utils.FactoryUtil;
+
+
+
+
+/**
+ * The StringTextLineFactory class provides a simple way to create TextLines from a string. 
+ * 
+ * <p>The text lines are static and are created using a single format and a single paragraph. 
+ * The lines are created to fit in the specified bounding rectangle.</p>
+ * 
+ * <p>The StringTextLineFactory provides an efficient way to create TextLines, since it reuses single TextFlow,
+ * ParagraphElement, SpanElement, and ContainerController objects across many repeated invocations. You can create a
+ * single factory, and use it again and again. You can also reuse all the parts that are the same each time
+ * you call it; for instance, you can reuse the various formats and the bounds.</p> 
+ *
+ * <p><b>Note:</b> To create static lines that use multiple formats or paragraphs, or that include
+ * inline graphics, use a TextFlowTextLineFactory and a TextFlow object. </p>
+ * 
+ * <p><b>Note:</b> The StringTextLineFactory ignores the truncationIndicatorFormat property set in the truncationOptions when truncating text.</p>
+ *  
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @langversion 3.0
+ *
+ * @see org.apache.flex.textLayout.factory.TextFlowTextLineFactory TextFlowTextLineFactory
+	 */
+	public class StringTextLineFactory extends TextLineFactoryBase implements IStringTextLineFactory
+	{
+		private var _tf:TextFlow;
+		private var _para:ParagraphElement;
+		private var _span:SpanElement;
+		private var _formatsChanged:Boolean;
+
+		static private var _defaultConfiguration:IConfiguration = null;
+		
+		private var _configuration:IConfiguration;
+		
+		/** 
+		 * The configuration used by the internal TextFlow object.
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function get configuration():IConfiguration
+		{
+			return _configuration; 
+		}
+		
+		/** 
+		 * The default configuration used by this factory if none is specified. 
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		static public function get defaultConfiguration():IConfiguration
+		{
+			if (!_defaultConfiguration)
+			{
+				_defaultConfiguration = Configuration.defaultConfiguration.clone();
+				_defaultConfiguration.flowComposerClass = FactoryUtil.getDefaultFlowComposerClass();
+				_defaultConfiguration.textFlowInitialFormat = null;
+			}
+			return _defaultConfiguration;
+		}
+		
+		/** 
+		 * Creates a StringTextLineFactory object.  
+		 * 
+		 * @param configuration The configuration object used to set the properties of the 
+		 * internal TextFlow object used to compose lines produced by this factory. 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function StringTextLineFactory(configuration:IConfiguration = null)
+		{
+			super();
+			initialize(configuration);
+		}
+		
+		private function initialize(config:IConfiguration):void
+		{	
+			_configuration = config ? config.getImmutableClone() : defaultConfiguration.getImmutableClone();
+			_tf = new TextFlow(TLFFactory.defaultTLFFactory, _configuration);
+			_para = new ParagraphElement();
+			_span = new SpanElement();
+			_para.replaceChildren(0, 0, _span);
+			_tf.replaceChildren(0, 0, _para);
+			
+			_tf.flowComposer.addController(containerController);
+			_formatsChanged = true;
+		}
+		
+		/** 
+		 * The character format. 
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function get spanFormat():ITextLayoutFormat
+		{
+			return _span.format;
+		}
+		public function set spanFormat(format:ITextLayoutFormat):void
+		{
+			_span.format = format;
+			_formatsChanged = true;
+		}
+		/** 
+		 * The paragraph format. 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function get paragraphFormat():ITextLayoutFormat
+		{
+			return _para.format;
+		}
+		public function set paragraphFormat(format:ITextLayoutFormat):void
+		{
+			_para.format = format;
+			_formatsChanged = true;
+		}
+		
+		/** 
+		 * The text flow format.
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function get textFlowFormat():ITextLayoutFormat
+		{
+			return _tf.format;
+		}
+		public function set textFlowFormat(format:ITextLayoutFormat):void
+		{
+			_tf.format = format;
+			_formatsChanged = true;
+		}
+		
+		/** 
+		 * The text to convert into ITextLine objects.
+		 * 
+		 * <p>To produce TextLines, call <code>createTextLines()</code> after setting this
+		 * <code>text</code> property and the desired formats.</p> 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function get text():String
+		{ return _span.text; }
+		public function set text(string:String):void
+		{
+			_span.text = string;
+		}
+		
+		/** @private  Used for measuring the truncation indicator */
+		static private var _measurementFactory:StringTextLineFactory = null;
+		static private function measurementFactory():StringTextLineFactory
+		{
+			if (_measurementFactory == null)
+				_measurementFactory = new StringTextLineFactory();
+			return _measurementFactory;
+		}
+		static private var _measurementLines:Array = null;
+		static private function measurementLines():Array
+		{
+			if (_measurementLines == null)
+				_measurementLines = new Array();
+			return _measurementLines;
+		}
+		
+		/** 
+		 * Creates ITextLine objects using the text currently assigned to this factory object.
+		 * 
+		 * <p>The text lines are created using the currently assigned text and formats and
+		 * are composed to fit the bounds assigned to the <code>compositionBounds</code> property.
+		 * As each line is created, the factory calls the function specified in the 
+		 * <code>callback</code> parameter. This function is passed the ITextLine object and
+		 * is responsible for displaying the line.</p>
+		 * 
+		 * <p>To create a different set of lines, change any properties desired and call
+		 * <code>createTextLines()</code> again.</p>
+		 *  
+		 * <p>Note that the scroll policies of the factory will control how many lines are generated.</p>
+		 * 
+		 * @param callback	The callback function called for each ITextLine object created.
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function createTextLines(callback:Function):void
+		{
+			var saved:ISimpleCompose = TextLineFactoryBase.beginFactoryCompose();
+			try
+			{
+				createTextLinesInternal(callback);
+			}
+			finally
+			{
+				FactoryHelper.staticComposer.lines.splice(0);
+				if (_pass0Lines)
+					_pass0Lines.splice(0);
+				TextLineFactoryBase.endFactoryCompose(saved);
+			}
+		}
+		
+		/** Internal version preserves generated lines
+		 */
+		private function createTextLinesInternal(callback:Function):void
+		{
+			var measureWidth:Boolean  = !compositionBounds || isNaN(compositionBounds.width);
+			var measureHeight:Boolean = !compositionBounds || isNaN(compositionBounds.height);
+
+			CONFIG::debug { assert(_tf.flowComposer.numControllers == 1,"DisplayController bad number containers"); }
+			CONFIG::debug { assert(containerController == _tf.flowComposer.getControllerAt(0),"ContainerController mixup"); }
+			var bp:String = _tf.computedFormat.blockProgression;
+
+			containerController.setCompositionSize(compositionBounds.width, compositionBounds.height);
+			// override scroll policy if truncation options are set
+			containerController.verticalScrollPolicy = truncationOptions ? ScrollPolicy.OFF : verticalScrollPolicy;
+			containerController.horizontalScrollPolicy = truncationOptions ? ScrollPolicy.OFF : horizontalScrollPolicy;
+
+			_isTruncated = false;
+			_truncatedText = text;
+			
+			if (!_formatsChanged && ContextUtil.computeBaseSWFContext(_tf.flowComposer.swfContext) != ContextUtil.computeBaseSWFContext(swfContext))
+				_formatsChanged = true;
+
+			_tf.flowComposer.swfContext = swfContext;
+			
+			if (_formatsChanged)
+			{
+				_tf.normalize();
+				_formatsChanged = false;
+			}
+
+			_tf.flowComposer.compose();
+			
+			// Need truncation if all the following are true
+			// - truncation options exist
+			// - content doesn't fit		
+			if (truncationOptions)
+				doTruncation(bp, measureWidth, measureHeight);
+			
+			var xadjust:Number = compositionBounds.x;
+			// toptobottom sets zero to the right edge - adjust the locations
+			var controllerBounds:Rectangle = containerController.getContentBounds();
+			if (bp == BlockProgression.RL)
+				xadjust += (measureWidth ? controllerBounds.width : compositionBounds.width);
+				
+			// apply x and y adjustment to the bounds
+			controllerBounds.left += xadjust;
+			controllerBounds.right += xadjust;
+			controllerBounds.top += compositionBounds.y;
+			controllerBounds.bottom += compositionBounds.y;			
+			
+			if (_tf.backgroundManager)
+				processBackgroundColors(_tf,callback,xadjust,compositionBounds.y,containerController.compositionWidth,containerController.compositionHeight);				
+			callbackWithTextLines(callback,xadjust,compositionBounds.y);
+
+			setContentBounds(controllerBounds);
+			containerController.clearCompositionResults();
+		}
+		
+		// Need truncation if all the following are true
+		// - truncation options exist
+		// - content doesn't fit		
+		/** @private */
+		public function doTruncation(bp:String, measureWidth:Boolean, measureHeight:Boolean):void
+		{
+			var bpString:String = _tf.computedFormat.blockProgression;
+			if (!doesComposedTextFit(truncationOptions.lineCountLimit, _tf.textLength, bpString))
+			{
+				_isTruncated = true;
+				var somethingFit:Boolean = false; // were we able to fit something?
+				var originalText:String = _span.text;
+				
+				computeLastAllowedLineIndex (truncationOptions.lineCountLimit);	
+				if (_truncationLineIndex >= 0)
+				{
+					// Estimate the initial truncation position using the following steps 
+					
+					// 1. Measure the space that the truncation indicator will take
+					measureTruncationIndicator (compositionBounds, truncationOptions.truncationIndicator);
+					
+					// 2. Move target line for truncation higher by as many lines as the number of full lines taken by the truncation indicator
+					_truncationLineIndex -= (_measurementLines.length -1);
+					if (_truncationLineIndex >= 0)
+					{
+						var truncateAtCharPosition:int;
+						
+						if (_tf.computedFormat.lineBreak == LineBreak.EXPLICIT || (bpString == BlockProgression.TB ? measureWidth : measureHeight))
+						{
+							// 3., 4. Initial truncation position: end of the last allowed line 
+							var line:ITextLine = FactoryHelper.staticComposer.lines[_truncationLineIndex] as ITextLine; 
+							truncateAtCharPosition =  line.userData + line.rawTextLength;
+						}
+						else
+						{
+							// 3. Calculate allowed width (width left over from the last line of the truncation indicator)
+							var targetWidth:Number = (bpString == BlockProgression.TB ? compositionBounds.width : compositionBounds.height); 
+							if (paragraphFormat)
+							{
+								targetWidth -= (Number(paragraphFormat.paragraphSpaceAfter) + Number(paragraphFormat.paragraphSpaceBefore));
+								if (_truncationLineIndex == 0)
+									targetWidth -= paragraphFormat.textIndent;
+							}
+							
+							var allowedWidth:Number = targetWidth - (_measurementLines[_measurementLines.length-1] as ITextLine).unjustifiedTextWidth;
+							
+							// 4. Get the initial truncation position on the target line given this allowed width 
+							truncateAtCharPosition = getTruncationPosition(FactoryHelper.staticComposer.lines[_truncationLineIndex], allowedWidth);
+						}
+						
+						// Save off the original lines: used in getNextTruncationPosition
+						if (!_pass0Lines)
+							_pass0Lines = new Array();
+						_pass0Lines = FactoryHelper.staticComposer.swapLines(_pass0Lines);
+						
+						// Note that for the original lines to be valid when used, the containing text block should not be modified
+						// Cloning the paragraph ensures this 
+						_para = _para.deepCopy() as ParagraphElement; 
+						_span = _para.getChildAt(0) as SpanElement;
+						_tf.replaceChildren(0, 1, _para);
+						_tf.normalize();
+						
+						// Replace all content starting at the inital truncation position with the truncation indicator
+						_span.replaceText(truncateAtCharPosition, _span.textLength, truncationOptions.truncationIndicator);
+						
+						// The following loop executes repeatedly composing text until it fits
+						// In each iteration, an atoms's worth of characters of original content is dropped
+						do
+						{
+							_tf.flowComposer.compose();
+							
+							if (doesComposedTextFit(truncationOptions.lineCountLimit, _tf.textLength, bpString))
+							{
+								somethingFit = true;
+								break; 
+							}		
+							
+							if (truncateAtCharPosition == 0)
+								break; // no original content left to make room for truncation indicator
+							
+							// Try again by truncating at the beginning of the preceding atom
+							var newTruncateAtCharPosition:int = getNextTruncationPosition(truncateAtCharPosition);
+							_span.replaceText(newTruncateAtCharPosition, truncateAtCharPosition, null);
+							truncateAtCharPosition = newTruncateAtCharPosition;
+							
+						} while (true);
+					}
+					_measurementLines.splice(0);	// cleanup
+				}
+				
+				if (somethingFit)
+					_truncatedText = _span.text;
+				else
+				{
+					_truncatedText = "";
+					FactoryHelper.staticComposer.lines.splice(0); // return no lines
+				}
+				
+				_span.text = originalText;
+			}
+		}
+		
+		/** @private 
+		 * Gets the text that is composed in the preceding call to <code>createTextLines</code>
+		 * If no truncation is performed, a string equal to <code>text</code> is returned. 
+		 * If truncation is performed, but nothing fits, an empty string is returned.
+		 * Otherwise, a substring of <code>text</code> followed by the truncation indicator is returned. 
+		 */
+		public function get truncatedText():String
+		{ return _truncatedText; }
+		private var _truncatedText:String;
+		
+		/** 
+		 * Measures the truncation indicator using the same bounds and formats, but without truncation options
+		 * Resultant lines are added to _measurementLines
+		 */
+		private function measureTruncationIndicator (compositionBounds:Rectangle, truncationIndicator:String):void
+		{
+			var originalLines:Array = FactoryHelper.staticComposer.swapLines(measurementLines()); // ensure we don't overwrite original lines
+			var measureFactory:StringTextLineFactory = measurementFactory();
+			measureFactory.compositionBounds = compositionBounds;
+			measureFactory.text = truncationIndicator;
+			measureFactory.spanFormat = spanFormat;
+			measureFactory.paragraphFormat = paragraphFormat;
+			measureFactory.textFlowFormat = textFlowFormat;
+			measureFactory.truncationOptions = null;
+			measureFactory.createTextLinesInternal(noopfunction);
+			FactoryHelper.staticComposer.swapLines(originalLines); // restore
+		}
+		
+		static private function noopfunction(o:Object):void	// No PMD
+		{ }
+		
+
+		/** 
+		 * Gets the truncation position on a line given the allowed width 
+		 * - Must be at an atom boundary
+		 * - Must scan the line for atoms in logical order, not physical position order
+         * For example, given bi-di text AB\u05d0\u05d1CD
+		 * atoms must be scanned in this order 
+         * A, B, \u05d0
+         * \u05d2, C, D  
+		 */
+		private function getTruncationPosition (line:ITextLine, allowedWidth:Number):uint
+		{			
+			var consumedWidth:Number = 0;
+			var charPosition:int = line.userData; 						// start of line
+			
+			while (charPosition < line.userData + line.rawTextLength)	// end of line
+			{
+				var atomIndex:int = line.getAtomIndexAtCharIndex(charPosition);
+				var atomBounds:Rectangle = line.getAtomBounds(atomIndex); 
+				consumedWidth += atomBounds.width;
+				if (consumedWidth > allowedWidth)
+					break;
+					
+				charPosition = line.getAtomTextBlockEndIndex(atomIndex);
+			}
+			
+			// line.flushAtomData(); // Warning: Now does nothing
+			return charPosition;
+		}
+		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TCMTextFlowTextLineFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TCMTextFlowTextLineFactory.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TCMTextFlowTextLineFactory.as
new file mode 100644
index 0000000..a8fdbf4
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TCMTextFlowTextLineFactory.as
@@ -0,0 +1,50 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.factory
+{
+	import org.apache.flex.textLayout.compose.IFlowComposer;
+	import org.apache.flex.textLayout.compose.TCMFactoryComposer;
+	import org.apache.flex.textLayout.container.TextContainerManager;
+
+	public class TCMTextFlowTextLineFactory extends TextFlowTextLineFactory
+	{
+		private var _tcm:TextContainerManager;
+
+		public function TCMTextFlowTextLineFactory()
+		{
+			super();
+		}
+
+		/** @private */
+		public override function createFlowComposer():IFlowComposer
+		{
+			return new TCMFactoryComposer(_tcm);
+		}
+
+		public function get tcm():TextContainerManager
+		{
+			return _tcm;
+		}
+
+		public function set tcm(val:TextContainerManager):void
+		{
+			_tcm = val;
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TLFFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TLFFactory.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TLFFactory.as
new file mode 100644
index 0000000..98bccb3
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TLFFactory.as
@@ -0,0 +1,10 @@
+package org.apache.flex.textLayout.factory
+{
+	public class TLFFactory
+	{
+		/**
+		 * Default ITLFFactory if one is not specified.
+		 */
+		public static var defaultTLFFactory:ITLFFactory = new StandardTLFFactory();
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TextFlowTextLineFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TextFlowTextLineFactory.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TextFlowTextLineFactory.as
new file mode 100644
index 0000000..de8e2a4
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TextFlowTextLineFactory.as
@@ -0,0 +1,285 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.factory
+{
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.geom.Rectangle;
+	import org.apache.flex.text.engine.ITextLine;
+	import org.apache.flex.textLayout.compose.FloatCompositionData;
+	import org.apache.flex.textLayout.compose.IFlowComposer;
+	import org.apache.flex.textLayout.compose.ISimpleCompose;
+	import org.apache.flex.textLayout.compose.utils.FactoryHelper;
+	import org.apache.flex.textLayout.container.ScrollPolicy;
+	import org.apache.flex.textLayout.debug.assert;
+	import org.apache.flex.textLayout.elements.IFlowGroupElement;
+	import org.apache.flex.textLayout.elements.IFlowLeafElement;
+	import org.apache.flex.textLayout.elements.ParagraphElement;
+	import org.apache.flex.textLayout.elements.SpanElement;
+	import org.apache.flex.textLayout.elements.ITextFlow;
+	import org.apache.flex.textLayout.formats.BlockProgression;
+	import org.apache.flex.textLayout.formats.Float;
+	import org.apache.flex.textLayout.formats.ITextLayoutFormat;
+
+/**
+ * The TextFlowTextLineFactory class provides a simple way to create TextLines for displaying text from a text flow.
+ * 
+ * <p>The text lines are static and created fit in a single bounding rectangle, but can have multiple paragraphs and formats as well as
+ * inline graphics. To create ITextLine objects directly from a string, use StringTextLineFactory.</p> 
+ *
+ * <p><b>Note:</b> When using inline graphics, the <code>source</code> property of the InlineGraphicElement object 
+ * must either be an instance of a DisplayObject or a Class object representing an embedded asset. 
+ * URLRequest objects cannot be used. The width and height of the inline graphic at the time the line 
+ * is created is used to compose the flow. </p>
+ * 
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @langversion 3.0
+ *
+ * @see org.apache.flex.textLayout.elements.TextFlow TextFlow
+ * @see org.apache.flex.textLayout.factory.StringTextLineFactory StringTextLineFactory
+*/
+	public class TextFlowTextLineFactory extends TextLineFactoryBase
+	{
+		/** 
+		 * Creates a TextFlowTextLineFactory object. 
+		 * 
+ 		 * @playerversion Flash 10
+ 		 * @playerversion AIR 1.5
+ 		 * @langversion 3.0
+ 		 */
+		public function TextFlowTextLineFactory()
+		{
+			super();
+		}
+
+		/**
+		 * Creates ITextLine objects from the specified text flow.
+		 * 
+		 * <p>The text lines are composed to fit the bounds assigned to the <code>compositionBounds</code> property.
+		 * As each line is created, the factory calls the function specified in the 
+		 * <code>callback</code> parameter. This function is passed the ITextLine object and
+		 * is responsible for displaying the line. If a line has a background color, the factory also calls the
+		 * callback function with a Shape object containing a rectangle of the background color.</p>
+		 * 
+		 * <p>Note that the scroll policies of the factory will control how many lines are generated.</p>
+		 * 
+		 * @param callback function to call with each generated ITextLine object.  
+		 * The callback will be called with a Shape object representing any background color (if present), 
+		 * and with ITextLine objects for the text.
+		 * @param textFlow The TextFlow from which the lines are created.
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 *
+		 */	
+		public function createTextLines(callback:Function,textFlow:ITextFlow):void
+		{
+			var saved:ISimpleCompose = TextLineFactoryBase.beginFactoryCompose();
+			try
+			{
+				createTextLinesInternal(callback,textFlow);
+			}
+			finally
+			{
+				textFlow.changeFlowComposer(null,false);
+				FactoryHelper.staticComposer.lines.splice(0);
+				if (_pass0Lines)
+					_pass0Lines.splice(0);
+				TextLineFactoryBase.endFactoryCompose(saved);
+			}
+		}
+		private  function createTextLinesInternal(callback:Function,textFlow:ITextFlow):void
+		{
+			var measureWidth:Boolean  = isNaN(compositionBounds.width);
+			
+			var bp:String = textFlow.computedFormat.blockProgression;
+						
+			var helper:IFlowComposer = createFlowComposer();
+			
+			helper.swfContext = swfContext;
+
+			helper.addController(containerController);
+			textFlow.flowComposer = helper; 
+			textFlow.clearBackgroundManager();
+			// this assertion is for TCM.  It's valid in other cases to use the factory but Links won't work and graphics may not load properly
+			CONFIG::debug { assert(!this.hasOwnProperty("tcm") || textFlow.mustUseComposer() == false,"Factory composing in TCM when interaction needed"); }
+			
+			_isTruncated = false;
+			
+			// compose
+			containerController.setCompositionSize(compositionBounds.width, compositionBounds.height);
+			containerController.verticalScrollPolicy = truncationOptions ? ScrollPolicy.OFF : verticalScrollPolicy;
+			containerController.horizontalScrollPolicy = truncationOptions ? ScrollPolicy.OFF : horizontalScrollPolicy;
+			textFlow.normalize();
+			textFlow.applyUpdateElements(true);
+
+			helper.compose();
+		
+			// Need truncation if all the following are true
+			// - truncation options exist
+			// - content doesn't fit		
+			if (truncationOptions && !doesComposedTextFit(truncationOptions.lineCountLimit, textFlow.textLength, bp))
+			{
+				_isTruncated = true;
+				var somethingFit:Boolean = false; // were we able to fit something?
+
+				computeLastAllowedLineIndex (truncationOptions.lineCountLimit);	
+				if (_truncationLineIndex >= 0)
+				{					
+					// Create a span for the truncation indicator
+					var truncationIndicatorSpan:SpanElement = new SpanElement();
+					truncationIndicatorSpan.text = truncationOptions.truncationIndicator; 
+					truncationIndicatorSpan.id = "truncationIndicator"; // prevents merging with other spans 
+					if (truncationOptions.truncationIndicatorFormat)
+						truncationIndicatorSpan.format = truncationOptions.truncationIndicatorFormat;
+					
+					var hostFormat:ITextLayoutFormat = textFlow.hostFormat;
+					
+					// Initial truncation position: end of the last allowed line
+					var line:ITextLine = FactoryHelper.staticComposer.lines[_truncationLineIndex] as ITextLine; 
+					var truncateAtCharPosition:int =  line.userData + line.rawTextLength;
+					
+					// Save off the original lines: used in getNextTruncationPosition
+					// Note that for the original lines to be valid when used, the containing text block should not be modified
+					// Cloning the text flow before modifying it ensures that
+					if (!_pass0Lines)
+						_pass0Lines = new Array();
+					_pass0Lines = FactoryHelper.staticComposer.swapLines(_pass0Lines); 
+
+					// The following loop executes repeatedly composing text until it fits
+					// In each iteration, an atoms's worth of characters of original content is dropped 
+					do
+					{
+						// Clone the part of the flow before the truncation position  
+						textFlow = textFlow.deepCopy(0, truncateAtCharPosition) as ITextFlow;
+						// TODO-2/18/2009-deepCopy does not copy hostTextLayoutFormat
+						if (hostFormat)
+							textFlow.hostFormat = hostFormat;
+						
+						// Find a parent for the truncation span
+						var parent:IFlowGroupElement;
+						var lastLeaf:IFlowLeafElement = textFlow.getLastLeaf();
+						if (lastLeaf)
+						{
+							parent = lastLeaf.parent;
+							// Set format to match the leaf if none specified 
+							if (!truncationOptions.truncationIndicatorFormat)
+								truncationIndicatorSpan.format = lastLeaf.format;
+						}
+						else
+						{
+							parent = new ParagraphElement();
+							textFlow.addChild(parent);
+						}
+					
+						// Append the truncation span (after severing it from the previous flow)
+						if (truncationIndicatorSpan.parent)
+							truncationIndicatorSpan.parent.removeChild(truncationIndicatorSpan);
+						parent.addChild(truncationIndicatorSpan);
+						
+						textFlow.flowComposer = helper;
+						textFlow.normalize();
+						
+						helper.compose();
+			
+						if (doesComposedTextFit(truncationOptions.lineCountLimit, textFlow.textLength, bp))
+						{
+							somethingFit = true;
+							break; 
+						}		
+						
+						if (truncateAtCharPosition == 0)
+							break; // no original content left to make room for truncation indicator
+						
+						// Try again by truncating at the beginning of the preceding atom
+						truncateAtCharPosition = getNextTruncationPosition(truncateAtCharPosition, true);
+
+					} while (true);
+				}
+				
+				if (_truncatedTextFlowCallback != null)
+					_truncatedTextFlowCallback (somethingFit ? textFlow : null);
+					
+				if (!somethingFit)
+					FactoryHelper.staticComposer.lines.splice(0); // return no lines
+			}
+			
+			var xadjust:Number = compositionBounds.x;
+			// toptobottom sets zero to the right edge - adjust the locations
+			var controllerBounds:Rectangle = containerController.getContentBounds();
+			if (bp == BlockProgression.RL)
+				xadjust += (measureWidth ? controllerBounds.width : compositionBounds.width);	
+			
+			// apply x and y adjustment to the bounds
+			controllerBounds.left += xadjust;
+			controllerBounds.right += xadjust;
+			controllerBounds.top += compositionBounds.y;
+			controllerBounds.bottom += compositionBounds.y;
+			
+			if (textFlow.backgroundManager)
+				processBackgroundColors(textFlow,callback,xadjust,compositionBounds.y,containerController.compositionWidth,containerController.compositionHeight);				
+			callbackWithTextLines(callback,xadjust,compositionBounds.y);
+
+			setContentBounds(controllerBounds);
+			containerController.clearCompositionResults();
+		}
+		
+		/** @private - documented in base class */
+		override protected function callbackWithTextLines(callback:Function,delx:Number,dely:Number):void
+		{
+			super.callbackWithTextLines(callback, delx, dely);
+			
+			// Handle floats and inlines as well
+			var numFloats:int = containerController.numFloats;
+			for (var i:int = 0; i < numFloats; ++i)
+			{
+				var floatInfo:FloatCompositionData = containerController.getFloatAt(i);
+				//TODO Figure out how to generalize this with interfaces
+				var inlineHolder:UIBase = new UIBase();	// NO PMD
+				inlineHolder.alpha = floatInfo.alpha;
+				//TODO handle transforms using beads.
+//				if (floatInfo.matrix)
+//					inlineHolder.transform.matrix = floatInfo.matrix;
+				inlineHolder.x += floatInfo.x;
+				inlineHolder.y += floatInfo.y;
+				inlineHolder.addElement(floatInfo.graphic);
+				if (floatInfo.floatType == Float.NONE)
+					floatInfo.parent.addElement(inlineHolder);
+				else 
+				{
+					inlineHolder.x += delx;
+					inlineHolder.y += dely;
+					callback(inlineHolder);
+				}
+			}
+		}
+		
+		/** @private 
+		 * Test hook: Sets a callback function for getting the truncated text flow.
+		 * This function is only called if truncation is performed. It takes a single parameter which will have the following value:
+		 * null, if nothing fits
+		 * A text flow representing the truncated text (containing inital text from the original text flow followed by the truncation indicator), otherwise 
+		 */
+		public function set truncatedTextFlowCallback(val:Function):void
+		{ _truncatedTextFlowCallback = val; }
+		
+		private var _truncatedTextFlowCallback:Function;
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TextLineFactoryBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TextLineFactoryBase.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TextLineFactoryBase.as
new file mode 100644
index 0000000..cccf0b6
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TextLineFactoryBase.as
@@ -0,0 +1,437 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.factory
+{
+	import org.apache.flex.textLayout.compose.ISimpleCompose;
+	import org.apache.flex.textLayout.compose.utils.FactoryHelper;
+	import org.apache.flex.core.IParentIUIBase;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.geom.Rectangle;
+	import org.apache.flex.graphics.IGraphicShape;
+	import org.apache.flex.svg.GraphicShape;
+	import org.apache.flex.text.engine.ITextBlock;
+	import org.apache.flex.text.engine.ITextLine;
+	import org.apache.flex.textLayout.compose.IFactoryComposer;
+	import org.apache.flex.textLayout.compose.IFlowComposer;
+	import org.apache.flex.textLayout.compose.ISWFContext;
+	import org.apache.flex.textLayout.compose.SimpleCompose;
+	import org.apache.flex.textLayout.container.ContainerUtil;
+	import org.apache.flex.textLayout.container.IContainerController;
+	import org.apache.flex.textLayout.container.ScrollPolicy;
+	import org.apache.flex.textLayout.debug.Debugging;
+	import org.apache.flex.textLayout.debug.assert;
+	import org.apache.flex.textLayout.elements.ITextFlow;
+
+	
+
+
+	[Exclude(name="containerController",kind="property")]	
+	[Exclude(name="setContentBounds",kind="method")]
+	[Exclude(name="callbackWithTextLines",kind="method")]
+	[Exclude(name="doesComposedTextFit",kind="method")]
+	[Exclude(name="getNextTruncationPosition",kind="method")]
+
+
+/**
+ * The TextLineFactoryBase class serves as the base class for the Text Layout Framework text line factories.
+ * 
+ * <p><b>Note:</b> Application code does not typically need to create or use a TextLineFactoryBase object directly.
+ * Use one of the derived text factory classes instead.</p>
+ *  
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @langversion 3.0
+ *
+ * @see org.apache.flex.textLayout.elements.TextFlow
+*/
+	public class TextLineFactoryBase implements ITextLineFactory
+	{
+		/** Requested logical bounds to wrap to */
+		private var _compositionBounds:Rectangle;
+
+		/** Bounds of composition results - where the text landed */
+		private var _contentBounds:Rectangle;
+		
+		/** @private */
+		protected var _isTruncated:Boolean = false;
+		
+		private var _horizontalScrollPolicy:String;
+		private var _verticalScrollPolicy:String;
+		private var _truncationOptions:TruncationOptions;
+		private var _containerController:IContainerController;
+
+//TODO figure out what this should be
+		static private var _tc:IParentIUIBase = new UIBase();
+		
+		private var _swfContext:ISWFContext;
+		
+		/** @private */
+		static private      var _savedFactoryComposer:ISimpleCompose;
+
+		/** @private */		
+		protected var _truncationLineIndex:int; 	// used during truncation
+		/** @private */		
+		protected var _pass0Lines:Array; 		// used during truncation
+		
+		/** @private return the next factory composer that will be used */
+		static public function peekFactoryCompose():ISimpleCompose
+		{
+			if (_savedFactoryComposer == null)
+				_savedFactoryComposer = new SimpleCompose();
+			return _savedFactoryComposer;
+		}
+		
+		/** @private support recursive calls into the factory */
+		static public function beginFactoryCompose():ISimpleCompose
+		{
+			var rslt:ISimpleCompose = FactoryHelper.staticComposer;
+			FactoryHelper.staticComposer = peekFactoryCompose();
+			_savedFactoryComposer = null;
+			return rslt;
+		}
+		
+		/** @private support recursive calls into the factory */
+		static public function endFactoryCompose(prevComposer:ISimpleCompose):void
+		{
+			_savedFactoryComposer = FactoryHelper.staticComposer;
+			FactoryHelper.staticComposer = prevComposer;
+		}
+		
+		/** 
+		 * Base-class constructor for text line factories.
+		 *  
+ 		 * <p><b>Note:</b> Application code does not typically need to create or use a TextLineFactoryBase object directly.
+		 * Use one of the derived text factory classes instead.</p>
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function TextLineFactoryBase()
+		{
+			_containerController = ContainerUtil.getController(_tc);
+			_horizontalScrollPolicy = _verticalScrollPolicy = String(ScrollPolicy.scrollPolicyPropertyDefinition.defaultValue);
+		}
+		
+		/**
+		 * The rectangle within which text lines are created.
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function get compositionBounds():Rectangle
+		{
+			return _compositionBounds;
+		}
+		
+		public function set compositionBounds(value:Rectangle):void
+		{
+			_compositionBounds = value;
+		}
+		
+		/**
+		 * The smallest rectangle in which the layed-out content fits.
+		 * 
+		 * <p><b>Note:</b> Truncated lines are not included in the size calculation.</p>
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function getContentBounds():Rectangle
+		{
+			return _contentBounds;
+		}
+		
+		/** @private */
+		protected function setContentBounds(controllerBounds:Rectangle):void
+		{
+			_contentBounds = controllerBounds;
+			_contentBounds.offset(compositionBounds.left, compositionBounds.top);
+		}
+		
+		/** 
+		* The ISWFContext instance used to make FTE calls as needed. 
+		*
+		* <p>By default, the ISWFContext implementation is this FlowComposerBase object.
+		* Applications can provide a custom implementation to use fonts
+		* embedded in a different SWF file or to cache and reuse text lines.</p>
+		* 
+		* @see org.apache.flex.textLayout.compose.ISWFContext
+		* 
+		* @playerversion Flash 10
+		* @playerversion AIR 1.5
+	 	* @langversion 3.0
+	 	*/
+ 	
+		public function get swfContext():ISWFContext
+		{
+			return _swfContext;
+		}
+		public function set swfContext(value:ISWFContext):void
+		{
+			_swfContext = value;
+		}
+		
+		/** 
+		 * Specifies the options for truncating the text if it doesn't fit in the composition bounds.
+		 *  
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function get truncationOptions():TruncationOptions
+		{
+			return _truncationOptions;
+		}
+		public function set truncationOptions(value:TruncationOptions):void
+		{
+			_truncationOptions = value;
+		}
+		
+		/** 
+		 * Indicates whether text was truncated when lines were last created.
+		 *  
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function get isTruncated():Boolean
+		{
+			return _isTruncated;
+		}
+
+		/** 
+		 * Specifies how lines are created when the composition bounds are not large enough.
+		 *  
+		 * <p>If set to <code>ScrollPolicy.ON</code> or <code>ScrollPolicy.AUTO</code>, all lines
+		 * are created. It is the your responsibility to scroll lines in the viewable area (and to
+		 * mask lines outside this area, if necessary). If set to <code>ScrollPolicy.OFF</code>, then 
+		 * only lines that fit within the composition bounds are created.</p>
+		 * 
+		 * <p>If the <code>truncationOptions</code> property is set, the scroll policy is ignored 
+		 * (and treated as <code>ScrollPolicy.OFF</code>).</p> 
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 * 
+		 * @see org.apache.flex.textLayout.compose.StandardFlowComposer
+		 * @see org.apache.flex.textLayout.container.ScrollPolicy
+		 * @see #truncationOptions
+	 	 */
+	 	 
+	 	public function get horizontalScrollPolicy():String
+		{
+			return _horizontalScrollPolicy;
+		}
+		public function set horizontalScrollPolicy(scrollPolicy:String):void
+		{
+			_horizontalScrollPolicy =  scrollPolicy;
+		}
+		
+		/** 
+		 * Specifies how lines are created when the composition bounds are not large enough.
+		 *  
+		 * <p>If set to <code>ScrollPolicy.ON</code> or <code>ScrollPolicy.AUTO</code>, all lines
+		 * are created. It is the your responsibility to scroll lines in the viewable area (and to
+		 * mask lines outside this area, if necessary). If set to <code>ScrollPolicy.OFF</code>, then 
+		 * only lines that fit within the composition bounds are created.</p>
+		 * 
+		 * <p>If the <code>truncationOptions</code> property is set, the scroll policy is ignored 
+		 * (and treated as <code>ScrollPolicy.OFF</code>).</p> 
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 * 
+		 * @see org.apache.flex.textLayout.compose.StandardFlowComposer
+		 * @see org.apache.flex.textLayout.container.ScrollPolicy
+		 * @see #truncationOptions
+	 	 */
+	 	 
+		public function get verticalScrollPolicy():String
+		{
+			return _verticalScrollPolicy;
+		}
+		public function set verticalScrollPolicy(scrollPolicy:String):void
+		{
+			_verticalScrollPolicy =  scrollPolicy;
+		}		
+				
+		/** @private */
+		protected function get containerController():IContainerController
+		{
+			return _containerController;
+		}
+		
+		/** 
+		 * Sends the created ITextLine objects to the client using the supplied callback function.
+		 * 
+		 * <p>This method sets the <code>x</code> and <code>y</code> properties of the line.</p>
+		 * 
+		 * @param callback the callback function supplied by the factory user
+		 * @param delx the horizontal offset
+		 * @param dely the vertical offset
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		protected function callbackWithTextLines(callback:Function,delx:Number,dely:Number):void
+		{
+			for each (var textLine:ITextLine in FactoryHelper.staticComposer.lines)
+			{
+				var textBlock:ITextBlock = textLine.textBlock;
+				if (textBlock)
+				{
+					CONFIG::debug { Debugging.traceFTECall(null,textBlock,"releaseLines",textBlock.firstLine, textBlock.lastLine); }	
+					textBlock.releaseLines(textBlock.firstLine,textBlock.lastLine);
+				}
+				textLine.userData = null;
+				textLine.x += delx;
+				textLine.y += dely;
+				textLine.validity = "static";
+				CONFIG::debug { Debugging.traceFTEAssign(textLine,"validity","static"); }
+				callback(textLine);
+			}
+		}
+		
+		/**
+		 * Indicates whether the composed text fits in the line count limit and includes all text
+		 *  
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */	
+		protected function doesComposedTextFit (lineCountLimit:int, textLength:uint, blockProgression:String):Boolean
+		{
+			if (lineCountLimit != TruncationOptions.NO_LINE_COUNT_LIMIT && FactoryHelper.staticComposer.lines.length > lineCountLimit)
+				return false; // Line count limit exceded
+			
+			var lines:Array = FactoryHelper.staticComposer.lines;
+		
+			if (!lines.length)
+				return textLength ? false /* something to compose, but no line could fit */ : true /* nothing to compose */; 
+				
+			// This code is only called when scrolling if OFF, so only lines that fit in bounds are generated
+			// Just check if the last line reaches the end of flow
+			var lastLine:ITextLine = lines[lines.length - 1] as ITextLine;
+			return lastLine.userData + lastLine.rawTextLength == textLength;
+		}
+		
+		/** 
+		 * Gets the next truncation position by shedding an atom's worth of characters.
+		 * 
+		 * @param truncateAtCharPosition the current truncation candidate position.
+		 * @param multiPara <code>true</code> if text has more than one paragraph.
+		 * 
+		 * @returns the next candidate truncation position.
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		protected function getNextTruncationPosition(truncateAtCharPosition:int, multiPara:Boolean=false):int
+		{
+			// 1. Get the position of the last character of the preceding atom
+			truncateAtCharPosition--; // truncateAtCharPosition-1, because truncateAtCharPosition is an atom boundary
+			
+			// Note: The current set of lines may not contain the next truncation position because the truncation indicator
+			// could combine with original content to form a word that does not afford a suitable break opportunity. 
+			// The combined word would then move to the next line, which may not have been composed if the bounds were exceeded.
+			// Therefore, this function needs to use the original lines (from before truncation is attempted). 
+			CONFIG::debug 
+			{ 
+				assert(_pass0Lines != null, "getNextTruncationPosition called before saving off lines from the first pass at composition"); 
+				assert(_truncationLineIndex < _pass0Lines.length, "index out of range in getNextTruncationPosition");
+			}
+			
+			// 2. Find the new target line (i.e., the line that has the new truncation position) 
+			// If the last truncation position was at the beginning of the target line, the new position may have moved to a previous line
+			// In any case, the new truncation position lies in the vicinity of the previous target line, so a linear search suffices
+			var line:ITextLine = _pass0Lines[_truncationLineIndex] as ITextLine;
+			do
+			{
+				if (truncateAtCharPosition >= line.userData && truncateAtCharPosition < line.userData + line.rawTextLength)
+					break;
+				if (truncateAtCharPosition < line.userData)
+					line = _pass0Lines[--_truncationLineIndex] as ITextLine;
+				else
+				{
+					CONFIG::debug {	assert(false, "truncation position should decrease monotonically");	}
+				}	
+			}
+			while (true);
+
+			var paraStart:int = multiPara ?  line.userData - line.textBlockBeginIndex : 0;
+			
+			// 3. Get the line atom index at this position			
+			var atomIndex:int = line.getAtomIndexAtCharIndex(truncateAtCharPosition - paraStart);
+			
+			// 4. Get the char index for this atom index
+			var nextTruncationPosition:int = line.getAtomTextBlockBeginIndex(atomIndex) + paraStart;
+			
+			//line.flushAtomData(); // Warning: Now does nothing
+			
+			return nextTruncationPosition;
+		} 
+		/** @private */
+		public function createFlowComposer():IFlowComposer
+		{
+			return FactoryHelper.getComposer();
+		}			
+		
+		/** @private
+		 * Calculates the last line that fits in the line count limit
+		 * The result is stored in  _truncationLineIndex
+		 * 
+		 * Note: This code is only called when scrolling is OFF, so only lines that fit in bounds are generated
+		 */
+		public function computeLastAllowedLineIndex (lineCountLimit:int):void
+		{			
+			_truncationLineIndex = FactoryHelper.staticComposer.lines.length - 1;
+
+			// if line count limit is smaller, use that
+			if (lineCountLimit != TruncationOptions.NO_LINE_COUNT_LIMIT && lineCountLimit <= _truncationLineIndex)
+				_truncationLineIndex = lineCountLimit - 1;
+		}
+		
+		
+		/** @private helper to process the background colors.  default implementation creates a shape and passes it to the callback */
+		public function processBackgroundColors(textFlow:ITextFlow,callback:Function,x:Number,y:Number,constrainWidth:Number,constrainHeight:Number):*
+		{
+			CONFIG::debug { assert(textFlow.backgroundManager != null,"Bad call to processBackgroundColors"); }
+			var bgShape:IGraphicShape = new GraphicShape();
+			textFlow.backgroundManager.drawAllRects(textFlow,bgShape,constrainWidth,constrainHeight);
+			bgShape.x = x;
+			bgShape.y = y;
+			callback(bgShape);
+			textFlow.clearBackgroundManager();
+		}
+	}
+
+} // end package
+
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TruncationOptions.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TruncationOptions.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TruncationOptions.as
new file mode 100644
index 0000000..5bb21cd
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/TruncationOptions.as
@@ -0,0 +1,154 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.factory
+{
+	import org.apache.flex.textLayout.formats.ITextLayoutFormat;
+	
+	/** 
+	 * The TruncationOptions class specifies options for limiting the number of lines of text 
+	 * created by a text line factory and for indicating when lines have been left out.
+	 * 
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0
+	 */
+	public final class TruncationOptions
+	{
+		/** 
+		 * Creates a TruncationOptions object.
+		 * 
+		 * @param truncationIndicator the string used to indicate that text has been truncated. 
+		 * It appears at the end of the composed text. The default value is the horizontal ellipsis (U+2026).
+		 * @param lineCountLimit specifies a truncation criterion in the form of the maximum 
+		 * number of lines allowed. The default value of <code>NO_LINE_COUNT_LIMIT</code> 
+		 * indicates that there is no line count limit.
+		 * @param truncationIndicatorFormat specifies the format for the truncation indicator. 
+		 * A null format (the default value) specifies that the truncation indicator assume 
+		 * the format of content just before the truncation point. The <code>TextLineFactory</code> 
+		 * methods that take a simple string as input also ignore this parameter and implement 
+		 * the default behavior.
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function TruncationOptions (truncationIndicator:String=HORIZONTAL_ELLIPSIS, lineCountLimit:int=NO_LINE_COUNT_LIMIT, truncationIndicatorFormat:ITextLayoutFormat=null)
+		{
+			this.truncationIndicator =  truncationIndicator;
+			this.truncationIndicatorFormat = truncationIndicatorFormat;
+			this.lineCountLimit = lineCountLimit;
+		}
+		
+		/** 
+		 * A string used to indicate that content could not be fully displayed
+		 * because of limits on the number of lines.
+		 * 
+		 * @return the truncation indicator
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function get truncationIndicator():String
+		{
+			return _truncationIndicator ? _truncationIndicator : HORIZONTAL_ELLIPSIS;
+		}
+		/** 
+		 * Sets the truncation indicator
+		 * @param val the string used to indicate that text has been truncated
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function set truncationIndicator(val:String):void
+		{
+			_truncationIndicator = val;
+		}
+		
+		/** 
+		 * The style applied to the truncation indicator string.
+		 * @return the format truncation indicator
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function get truncationIndicatorFormat():ITextLayoutFormat
+		{
+			return _truncationIndicatorFormat;
+		}
+		/** 
+		 * Sets the styles applied to the truncation indicator character
+		 * 
+		 * @param val specifies the format for the truncation indicator. A null format specifies that the truncation indicator assume the format of content
+		 * just before the truncation point. The <code>TextLineFactory</code> methods that take a simple string as input also ignore this parameter and implement the default behavior
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function set truncationIndicatorFormat(val:ITextLayoutFormat):void
+		{
+			_truncationIndicatorFormat = val;
+		}
+		
+		/** 
+		 * The maximum number of lines to create.
+		 * @return the line count limit
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function get lineCountLimit():int
+		{
+			return _lineCountLimit < NO_LINE_COUNT_LIMIT ? 0 : _lineCountLimit;
+		}
+		/** 
+		 * Sets the maximum number of lines to create
+		 * @param val specifies the maximum number of lines allowed. 
+		 * A value of <code>NO_LINE_COUNT_LIMIT</code> indicates that there is no line count limit.
+		 */
+		public function set lineCountLimit(val:int):void
+		{
+			_lineCountLimit = val;
+		} 
+		
+		private var _truncationIndicator:String;
+		private var _truncationIndicatorFormat:ITextLayoutFormat;
+		private var _lineCountLimit:int;
+		
+		/**
+		 * Defines the <code>lineCountLimit</code> property value, <code>-1</code>, that represents no limit.
+		 *
+		 * @see #lineCountLimit
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public static const NO_LINE_COUNT_LIMIT:int = -1;
+
+		/**
+		 * Defines the <code>truncationIndicator</code> property value, <code>\u2026</code>, that represents a horizontal ellipsis.
+		 *
+		 * @see #truncationIndicator
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public static const HORIZONTAL_ELLIPSIS:String = "\u2026";
+	}	
+}
+
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BackgroundColor.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BackgroundColor.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BackgroundColor.as
new file mode 100644
index 0000000..ced1ed4
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BackgroundColor.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.formats
+{
+	/**
+	 *  Defines a constant for specifying that the value of the <code>backgroundColor</code> property
+	 *  of the <code>TextLayoutFormat</code> class is "transparent".
+	 *
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0 
+	 * @see org.apache.flex.textLayout.formats.TextLayoutFormat#backgroundColor TextLayoutFormat.backgroundColor
+	 */
+	public final class BackgroundColor
+	{
+		/** Transparent - no background color is applied.
+		 *
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	 	 * @langversion 3.0
+	 	 */
+	 	 
+		public static const TRANSPARENT:String = "transparent";
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BaselineOffset.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BaselineOffset.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BaselineOffset.as
new file mode 100644
index 0000000..a8cf5c9
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BaselineOffset.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.formats
+{
+	/**
+	 *  Defines values for the <code>firstBaselineOffset</code> property
+	 *  of the <code>TextLayoutFormat</code> and <code>ContainerFormattedElement</code> classes. 
+	 *  Determines the offset from the top inset of the container
+	 *  to the baseline of the first line. Baseline offset may be specified as 
+	 *  the ascent of the line, the height of the line, or an auto generated amount.
+	 *  <p>
+	 *  <img src="../../../images/textLayout_FBO1.jpg" alt="firstBaselineOffset_1" border="0"/>
+	 *  <img src="../../../images/textLayout_FBO2.jpg" alt="firstBaselineOffset_2" border="0"/>
+	 *  <img src="../../../images/textLayout_FBO3.jpg" alt="firstBaselineOffset_3" border="0"/>
+	 *  <img src="../../../images/textLayout_FBO4.jpg" alt="firstBaselineOffset_4" border="0"/>
+	 *  </p>
+	 *
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0 
+	 *  @see TextLayoutFormat#firstBaselineOffset
+	 */
+	public final class BaselineOffset
+	{
+		/** Aligns the ascent of the line with the container top inset.
+		 *
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	 	 * @langversion 3.0
+	 	 */
+	 	 
+		public static const AUTO:String = "auto";
+		
+		/** Specifies an offset equal to the ascent of the line, that is, the ascent of the tallest font in the line, accounting for inline graphics as having the bottom of the graphic on the baseline.
+		 *
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		 
+		public static const ASCENT:String = "ascent";
+		
+		/** Specifies an offset equal to the height of the line.
+		 *
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	 	 * @langversion 3.0
+	 	 */
+	 	 
+		public static const LINE_HEIGHT:String = "lineHeight";		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BaselineShift.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BaselineShift.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BaselineShift.as
new file mode 100644
index 0000000..599a954
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BaselineShift.as
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.formats
+{
+	/**
+	 *  Defines constants for specifying subscript or superscript in the <code>baselineShift</code> property
+	 *  of the <code>TextLayoutFormat</code> class. You can specify baseline shift as an absolute pixel offset, 
+	 *  a percentage of the current point size, or the constants SUPERSCRIPT or 
+	 *  SUBSCRIPT. Positive values shift the line up for horizontal text (right for vertical) and negative values 
+	 *  shift it down for horizontal (left for vertical). 
+	 *
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0
+	 *
+	 *  @see org.apache.flex.textLayout.formats.TextLayoutFormat#baselineShift TextLayoutFormat.baselineShift
+	 */
+	public final class BaselineShift
+	{
+		/** Shifts baseline to the current superscript position.
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	 	 * @langversion 3.0
+	 	 */
+	 	 
+		public static const SUPERSCRIPT:String = "superscript";
+		
+		/** Shifts baseline to the current subscript position.
+		 *
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		 
+		public static const SUBSCRIPT:String = "subscript";		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BlockProgression.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BlockProgression.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BlockProgression.as
new file mode 100644
index 0000000..43d8877
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BlockProgression.as
@@ -0,0 +1,58 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.formats
+{
+	/**
+	 *  Defines values for the <code>blockProgression</code> property
+	 *  of the <code>TextLayouFormat</code> class. BlockProgression specifies the direction in 
+	 *  which lines are placed in the container.
+	 *
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0 
+	 * 
+	 *  @see org.apache.flex.textLayout.formats.TextLayoutFormat#blockProgression TextLayoutFormat.blockProgression
+	 */
+	 
+	public final class BlockProgression
+	{
+		/** 
+		 *  Specifies right to left block progression. Lines are laid out vertically starting at the right 
+		 *  edge of the container and progressing leftward. Used for vertical text, for example, vertical 
+		 *  Chinese or Japanese text. 
+		 *
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	  	 * @langversion 3.0 
+	 	 */
+	 	 
+		public static const RL:String = "rl";
+		
+		/** 
+		 *  Specifies top to bottom block progression. Lines are laid out horizontally starting at the top of 
+		 *  the container and progressing down to the bottom. Used for horizontal text. 
+		 * 
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	  	 * @langversion 3.0 
+	  	 */
+	  	 
+		public static const TB:String = "tb";				
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BorderColor.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BorderColor.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BorderColor.as
new file mode 100644
index 0000000..2992bfa
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BorderColor.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.formats
+{
+	/**
+	 *  Defines a constant for specifying that the value of the <code>borderColor</code> property
+	 *  of the <code>TextLayoutFormat</code> class is "transparent".
+	 *
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0 
+	 * @see org.apache.flex.textLayout.formats.TextLayoutFormat#borderColor TextLayoutFormat.borderColor
+	 */
+	public final class BorderColor
+	{
+		/** Transparent - no border color is applied.
+		 *
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	 	 * @langversion 3.0
+	 	 */
+	 	 
+		public static const TRANSPARENT:String = "transparent";
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BorderStyle.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BorderStyle.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BorderStyle.as
new file mode 100644
index 0000000..b1ac3c0
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BorderStyle.as
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.formats
+{
+	/**
+	 *  Defines a constant for specifying that the value of the <code>borderStyle</code> property
+	 *  of the <code>TextLayoutFormat</code> class.
+	 *
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0 
+	 * @see org.apache.flex.textLayout.formats.TextLayoutFormat#borderStyle TextLayoutFormat.borderStyle
+	 */
+	public final class BorderStyle
+	{
+		/** none - no border style is applied.
+		 *
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	 	 * @langversion 3.0
+	 	 */
+	 	 
+		public static const NONE:String = "none";
+		
+		/** hidden - border is hidden.
+		 *
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	 	 * @langversion 3.0
+	 	 */
+	 	 
+		public static const HIDDEN:String = "hidden";
+		
+		/** dotted - border is made up of dotted lines.
+		 *
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	 	 * @langversion 3.0
+	 	 */
+	 	 
+		public static const DOTTED:String = "dotted";
+		
+		/** dashed - border is made up of dashed lines.
+		 *
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	 	 * @langversion 3.0
+	 	 */
+	 	 
+		public static const DASHED:String = "dashed";
+		
+		/** solid - border is made up of solid lines.
+		 *
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	 	 * @langversion 3.0
+	 	 */
+	 	 
+		public static const SOLID:String = "solid";
+		
+		/** double - border is made up of double lines.
+		 *
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	 	 * @langversion 3.0
+	 	 */
+	 	 
+		public static const DOUBLE:String = "double";
+		
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BreakStyle.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BreakStyle.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BreakStyle.as
new file mode 100644
index 0000000..9413ead
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/BreakStyle.as
@@ -0,0 +1,47 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.formats
+{
+	/**
+	 *
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0
+	 *
+	 */
+	public final class BreakStyle
+	{
+		/** 
+		 * @playerversion Flash 10
+	 	 * @playerversion AIR 1.5
+	 	 * @langversion 3.0
+	 	 */
+	 	 
+		public static const AUTO:String = "auto";
+		
+		/** 
+		 *
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		 
+		public static const ALWAYS:String = "always";		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/Category.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/Category.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/Category.as
new file mode 100644
index 0000000..f4859e5
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/formats/Category.as
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.formats
+{
+	// [ExcludeClass]
+	/**
+	 *  Property categories
+	 * @private
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0 
+	 */
+	public final class Category
+	{
+		public static const PARAGRAPH:String = "Paragraph";
+		public static const CONTAINER:String = "Container";
+		public static const CHARACTER:String = "Character";
+		public static const LIST:String 	 = "List";
+		public static const TABSTOP:String   = "TabStop";
+		public static const STYLE:String     = "Style";
+		public static const TABLE:String     = "Table";
+		public static const TABLECELL:String     = "TableCell";
+		public static const TABLEROW:String     = "TableRow";
+		public static const TABLECOLUMN:String     = "TableColumn";
+	}
+}