You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/08/14 07:58:13 UTC

[royale-asjs] branch feature/MXRoyale updated (d9a8dfb -> 85931a2)

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a change to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.


    from d9a8dfb  get spark layout working
     new ca8c17c  add scale properties to format.  multiparagraph textflows seemed to fail calculating leading
     new 550761c  insert contentarea layout sooner so the base class doesn't add a default layout first
     new af65a24  set some default styles for TLF
     new 213e224  stop returning 0 as a default.  We need some styles to return undefined
     new 37c3e7a  add TLF and Reflection to SparkRoyale
     new e80ef04  get RichText to use TLF
     new 85931a2  switch to using just 'padding' so it doesn't overrule other padding.  The CSS lookup may need to be smarter about rule precedence

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/config/compile-js-config.xml          |   5 +-
 .../org/apache/royale/html/beads/PanelView.as      |  12 +-
 .../MXRoyale/src/main/resources/defaults.css       |   7 +
 .../MXRoyale/src/main/royale/MXRoyaleClasses.as    |   3 +-
 .../main/royale/mx/containers/beads/BoxLayout.as   |   8 +-
 .../main/royale/mx/containers/beads/PanelView.as   |   9 +-
 .../MXRoyale/src/main/royale/mx/core/Container.as  |   9 +-
 .../src/main/royale/mx/core/UIComponent.as         |   2 +-
 .../src/main/royale/mx/styles/IStyleClient.as      | 268 +++++++++++++++++++++
 .../src/main/config/compile-swf-config.xml         |   3 +
 .../src/main/royale/spark/components/RichText.as   | 194 +++++++++------
 .../spark/components/supportClasses/TextBase.as    |  73 ++++--
 .../main/royale/spark/core/CSSTextLayoutFormat.as  | 153 ++++++++++++
 .../royale/textLayout/formats/TextLayoutFormat.as  |   2 +
 14 files changed, 637 insertions(+), 111 deletions(-)
 create mode 100644 frameworks/projects/MXRoyale/src/main/royale/mx/styles/IStyleClient.as
 create mode 100644 frameworks/projects/SparkRoyale/src/main/royale/spark/core/CSSTextLayoutFormat.as


[royale-asjs] 02/07: insert contentarea layout sooner so the base class doesn't add a default layout first

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 550761c20793dbb3c26c2fa897039401eb634f0a
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Aug 13 23:25:40 2018 -0700

    insert contentarea layout sooner so the base class doesn't add a default layout first
---
 .../main/royale/org/apache/royale/html/beads/PanelView.as    | 12 ++++++++++--
 .../src/main/royale/mx/containers/beads/PanelView.as         |  9 +++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/PanelView.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/PanelView.as
index f419f5a..4d459c2 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/PanelView.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/PanelView.as
@@ -177,8 +177,11 @@ package org.apache.royale.html.beads
 				_contentArea.typeNames = "PanelContent";
 
 				// add the layout bead to the content area.
-				if (transferLayoutBead) _contentArea.addBead(transferLayoutBead);
-
+				if (transferLayoutBead) 
+                    _contentArea.addBead(transferLayoutBead);
+                else
+                    setupContentAreaLayout();
+                
 				// add the viewport bead to the content area.
 				if (transferViewportBead) _contentArea.addBead(transferViewportBead);
 
@@ -201,6 +204,11 @@ package org.apache.royale.html.beads
             setupLayout();
         }
         
+        protected function setupContentAreaLayout():void
+        {
+            
+        }
+        
         protected function setupLayout():void
         {
             COMPILE::JS {
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
index 75393d8..84bac6c 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
@@ -67,7 +67,11 @@ public class PanelView extends org.apache.royale.html.beads.PanelView
     {
         titleBar = new PanelTitleBar();
         super.strand = value;
-        var model:PanelModel = (value as UIBase).model as PanelModel;
+    }
+    
+    override protected function setupContentAreaLayout():void
+    {
+        var model:PanelModel = (_strand as UIBase).model as PanelModel;
         var _layout:String = model.layout;
         var layoutObject:IBead;
         if (_layout == ContainerLayout.ABSOLUTE)
@@ -83,9 +87,10 @@ public class PanelView extends org.apache.royale.html.beads.PanelView
                 BoxLayout(layoutObject).direction
                     = BoxDirection.HORIZONTAL;
         }
-            
+        
         if (layoutObject)
             contentArea.addBead(layoutObject);            
+        
     }
     
     override protected function setupLayout():void


[royale-asjs] 04/07: stop returning 0 as a default. We need some styles to return undefined

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 213e2244b4d7a71967214d24674025b8e67a7f0d
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Aug 13 23:28:23 2018 -0700

    stop returning 0 as a default.  We need some styles to return undefined
---
 frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
index a47a151..76d07e1 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -4338,7 +4338,7 @@ public class UIComponent extends UIBase
 //            trace("getStyle not implemented");
 //        return 0;
 		var value:* = ValuesManager.valuesImpl.getValue(this,styleProp);
-		if (!value) value = 0;
+//		if (!value) value = 0;
 		return value;
     }
 


[royale-asjs] 05/07: add TLF and Reflection to SparkRoyale

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 37c3e7a6f982e6503447f2a90c9f29228b823e06
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Aug 13 23:29:37 2018 -0700

    add TLF and Reflection to SparkRoyale
---
 .../src/main/config/compile-js-config.xml          |   5 +-
 .../MXRoyale/src/main/royale/MXRoyaleClasses.as    |   3 +-
 .../src/main/royale/mx/styles/IStyleClient.as      | 268 +++++++++++++++++++++
 .../src/main/config/compile-swf-config.xml         |   3 +
 4 files changed, 277 insertions(+), 2 deletions(-)

diff --git a/frameworks/js/projects/SparkRoyaleJS/src/main/config/compile-js-config.xml b/frameworks/js/projects/SparkRoyaleJS/src/main/config/compile-js-config.xml
index 5efdd15..c9785ab 100644
--- a/frameworks/js/projects/SparkRoyaleJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/projects/SparkRoyaleJS/src/main/config/compile-js-config.xml
@@ -68,10 +68,13 @@
             <path-element>../../../../../libs/EffectsJS.swc</path-element>
             <path-element>../../../../../libs/ExpressJS.swc</path-element>
             <path-element>../../../../../libs/GraphicsJS.swc</path-element>
+            <path-element>../../../../../libs/NetworkJS.swc</path-element>
             <path-element>../../../../../libs/ChartsJS.swc</path-element>
             <path-element>../../../../../libs/MXRoyaleJS.swc</path-element>
+            <path-element>../../../../../libs/ReflectionJS.swc</path-element>
+            <path-element>../../../../../libs/TextJS.swc</path-element>
+            <path-element>../../../../../libs/TLFJS.swc</path-element>
             <path-element>../../../../../libs/XMLJS.swc</path-element>
-	    <path-element>../../../../../libs/NetworkJS.swc</path-element>
         </library-path>
         
         <namespaces>
diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index e8f89a2..b9a17b9 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -105,7 +105,8 @@ internal class MXRoyaleClasses
 	import mx.rpc.Responder; Responder;
 	import mx.printing.FlexPrintJobScaleType; FlexPrintJobScaleType; 
 	import mx.skins.RectangularBorder; RectangularBorder;
-	import mx.styles.ISimpleStyleClient; ISimpleStyleClient; 
+	import mx.styles.IStyleClient; IStyleClient; 
+    import mx.styles.ISimpleStyleClient; ISimpleStyleClient; 
 	import mx.styles.StyleProxy; StyleProxy;
     import mx.styles.StyleManagerImpl; StyleManagerImpl;
 	import mx.modules.IModuleInfo; IModuleInfo;
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/styles/IStyleClient.as b/frameworks/projects/MXRoyale/src/main/royale/mx/styles/IStyleClient.as
new file mode 100644
index 0000000..6728e4e
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/styles/IStyleClient.as
@@ -0,0 +1,268 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mx.styles
+{
+
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.ISimpleStyleClient;
+
+/**
+ *  This interface describes the properties and methods that an object 
+ *  must implement so that it can fully participate in the style subsystem. 
+ *  This interface is implemented by UIComponent.
+ *
+ *  <p>If the object does not need to store style values locally, it can 
+ *  implement the <code>ISimpleStyleClient</code> interface instead.</p>
+ *
+ *  @see mx.styles.ISimpleStyleClient
+ *  @see mx.styles.CSSStyleDeclaration
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public interface IStyleClient extends ISimpleStyleClient
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  className
+    //----------------------------------
+
+    /**
+     *  The name of the component class.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    function get className():String;
+
+    //----------------------------------
+    //  inheritingStyles
+    //----------------------------------
+
+    /**
+     *  An object containing the inheritable styles for this component.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    //function get inheritingStyles():Object;
+
+    /**
+     *  @private
+     */
+    //function set inheritingStyles(value:Object):void;
+
+    //----------------------------------
+    //  nonInheritingStyles
+    //----------------------------------
+
+    /**
+     *  An object containing the noninheritable styles for this component.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    //function get nonInheritingStyles():Object;
+
+    /**
+     *  @private
+     */
+    //function set nonInheritingStyles(value:Object):void;
+
+    //----------------------------------
+    //  styleDeclaration
+    //----------------------------------
+
+    /**
+     *  The style declaration that holds the inline styles declared by this
+     *  object.
+     *
+     *  @see mx.styles.CSSStyleDeclaration
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    //function get styleDeclaration():CSSStyleDeclaration;
+
+    /**
+     *  @private
+     */
+    //function set styleDeclaration(value:CSSStyleDeclaration):void;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Gets a style property that has been set anywhere in this
+     *  component's style lookup chain.
+     *
+     *  <p>This same method is used to get any kind of style property,
+     *  so the value returned may be a Boolean, String, Number, int,
+     *  uint (for an RGB color), Class (for a skin), or any kind of object.
+     *  Therefore the return type is specified as ~~.</p>
+     *
+     *  <p>If you are getting a particular style property, you will
+     *  know its type and will often want to store the result in a
+     *  variable of that type. You can use either the <code>as</code>
+     *  operator or coercion to do this. For example:</p>
+     *
+     *  <pre>
+     *  var backgroundColor:uint = getStyle("backgroundColor") as int;
+     *  
+     *  or
+     *  
+     *  var backgroundColor:uint = int(getStyle("backgroundColor"));
+     *  </pre>
+     *
+     *  <p>If the style property has not been set anywhere in the
+     *  style lookup chain, the value returned by the <code>getStyle()</code> method
+     *  is <code>undefined</code>.
+     *  Note that <code>undefined</code> is a special value that is
+     *  not the same as <code>false</code>, the empty String (<code>""</code>),
+     *  <code>NaN</code>, 0, or <code>null</code>.
+     *  No valid style value is ever <code>undefined</code>.
+     *  You can use the static method
+     *  <code>StyleManager.isValidStyleValue()</code>
+     *  to test whether the value was set.</p>
+     *
+     *  @param styleProp Name of the style property.
+     *
+     *  @return Style value.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    function getStyle(styleProp:String):*;
+
+    /**
+     *  Sets a style property on this component instance.
+     *
+     *  <p>This may override a style that was set globally.</p>
+     *
+     *  <p>Calling the <code>setStyle()</code> method can result in decreased performance.
+     *  Use it only when necessary.</p>
+     *
+     *  @param styleProp Name of the style property.
+     *
+     *  @param newValue New value for the style.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    //function setStyle(styleProp:String, newValue:*):void
+
+    /**
+     *  Deletes a style property from this component instance.
+     *
+     *  <p>This does not necessarily cause the <code>getStyle()</code> method to return
+     *  <code>undefined</code>.</p>
+     *
+     *  @param styleProp Name of the style property.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    //function clearStyle(styleProp:String):void;
+
+    /**
+     *  Returns an Array of CSSStyleDeclaration objects for the type selector
+     *  that applies to this component, or <code>null</code> if none exist.
+     *
+     *  <p>For example, suppose that component MyButton extends Button.
+     *  This method first looks for a MyButton selector; then, it looks for a Button type selector;
+     *  finally, it looks for a UIComponent type selector.</p>
+     *
+     *  @return Array of CSSStyleDeclaration objects.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    //function getClassStyleDeclarations():Array; // of CSSStyleDeclaration;
+
+    /**
+     *  Propagates style changes to the children of this component.
+     *
+     *  @param styleProp Name of the style property.
+     *
+     *  @param recursive Whether to propagate the style changes to the children's children. 
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    //function notifyStyleChangeInChildren(styleProp:String,
+    //                                     recursive:Boolean):void;
+
+    /**
+     *  Sets up the internal style cache values so that the <code>getStyle()</code> 
+     *  method functions.
+     *  If this object already has children, then reinitialize the children's
+     *  style caches.
+     *
+     *  @param recursive Regenerate the proto chains of the children. 
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    //function regenerateStyleCache(recursive:Boolean):void;
+
+    /**
+     *  Registers the EffectManager as one of the event listeners for each effect event.
+     *
+     *  @param effects An Array of Strings of effect names. 
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    //function registerEffects(effects:Array /* of String */):void
+}
+
+}
diff --git a/frameworks/projects/SparkRoyale/src/main/config/compile-swf-config.xml b/frameworks/projects/SparkRoyale/src/main/config/compile-swf-config.xml
index 99547c5..20a0a17 100644
--- a/frameworks/projects/SparkRoyale/src/main/config/compile-swf-config.xml
+++ b/frameworks/projects/SparkRoyale/src/main/config/compile-swf-config.xml
@@ -36,6 +36,9 @@
             <path-element>../../../../../libs/Collections.swc</path-element>
             <path-element>../../../../../libs/Graphics.swc</path-element>
             <path-element>../../../../../libs/MXRoyale.swc</path-element>
+            <path-element>../../../../../libs/Reflection.swc</path-element>
+            <path-element>../../../../../libs/Text.swc</path-element>
+            <path-element>../../../../../libs/TLF.swc</path-element>
             <path-element>../../../../../libs/XML.swc</path-element>
 	    <path-element>../../../../../libs/Network.swc</path-element>
         </external-library-path>


[royale-asjs] 06/07: get RichText to use TLF

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit e80ef04b08f9e6245496b2b293733dcab3670fd8
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Aug 13 23:29:58 2018 -0700

    get RichText to use TLF
---
 .../src/main/royale/spark/components/RichText.as   | 194 +++++++++++++--------
 .../spark/components/supportClasses/TextBase.as    |  73 +++++---
 .../main/royale/spark/core/CSSTextLayoutFormat.as  | 153 ++++++++++++++++
 3 files changed, 322 insertions(+), 98 deletions(-)

diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RichText.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RichText.as
index 5292fd0..4a77c87 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RichText.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RichText.as
@@ -26,36 +26,37 @@ import flash.text.TextFormat;
 import flashx.textLayout.compose.ISWFContext;
 import flashx.textLayout.conversion.ConversionType;
 import flashx.textLayout.conversion.ITextExporter;
-import flashx.textLayout.conversion.ITextImporter;
-import flashx.textLayout.conversion.TextConverter;
 import flashx.textLayout.elements.Configuration;
 import flashx.textLayout.elements.GlobalSettings;
-import flashx.textLayout.elements.TextFlow;
-import flashx.textLayout.events.DamageEvent;
-import flashx.textLayout.factory.StringTextLineFactory;
-import flashx.textLayout.factory.TextFlowTextLineFactory;
-import flashx.textLayout.factory.TextLineFactoryBase;
-import flashx.textLayout.factory.TruncationOptions;
-import flashx.textLayout.formats.ITextLayoutFormat;
-import flashx.textLayout.tlf_internal;
-
-import mx.core.IEmbeddedFontRegistry;
-import mx.core.IFlexModuleFactory;
-import mx.core.IUIComponent;
-import mx.core.Singleton;
-import mx.core.UIComponent;
+*/
+import mx.core.mx_internal;
+import mx.styles.IStyleClient;
 
+import spark.components.supportClasses.TextBase;
 import spark.core.CSSTextLayoutFormat;
-import spark.core.MaskType;
-import spark.utils.MaskUtil;
-import spark.utils.TextUtil;
 
-use namespace tlf_internal
-*/
-import spark.components.supportClasses.TextBase;
-import mx.core.mx_internal;
+import org.apache.royale.text.engine.ITextLine;
+import org.apache.royale.textLayout.conversion.ITextImporter;
+import org.apache.royale.textLayout.conversion.TextConverter;
+import org.apache.royale.textLayout.elements.ITextFlow;
+import org.apache.royale.textLayout.elements.TextFlow;
+import org.apache.royale.textLayout.events.DamageEvent;
+import org.apache.royale.textLayout.factory.StringTextLineFactory;
+import org.apache.royale.textLayout.factory.TLFFactory;
+import org.apache.royale.textLayout.factory.StandardTLFFactory;
+import org.apache.royale.textLayout.factory.TextFlowTextLineFactory;
+import org.apache.royale.textLayout.factory.TextLineFactoryBase;
+import org.apache.royale.textLayout.formats.ITextLayoutFormat;
+
 use namespace mx_internal;
 
+COMPILE::JS
+{
+    import org.apache.royale.html.util.addElementToWrapper;
+    import org.apache.royale.core.WrappedHTMLElement;        
+}
+import org.apache.royale.events.Event;        
+
 //--------------------------------------
 //  Styles
 //--------------------------------------
@@ -232,7 +233,7 @@ include "../styles/metadata/AdvancedNonInheritingTextStyles.as"
  *  
  *  @includeExample examples/RichTextExample.mxml
  */
-public class RichText extends TextBase
+public class RichText extends TextBase implements IStyleClient
 {
 //    include "../core/Version.as";
 
@@ -245,7 +246,7 @@ public class RichText extends TextBase
     /**
      *  @private
      */
-    //private static var classInitialized:Boolean = false;
+    private static var classInitialized:Boolean = false;
     
     /**
      *  @private
@@ -253,7 +254,7 @@ public class RichText extends TextBase
      *  We use it when the 'text' property is set to a String
      *  that doesn't contain linebreaks.
      */
-    //private static var staticStringFactory:StringTextLineFactory;
+    private static var staticStringFactory:StringTextLineFactory;
     
     /**
      *  @private
@@ -263,14 +264,14 @@ public class RichText extends TextBase
      *  that contains linebreaks (and therefore is interpreted
      *  as multiple paragraphs).
      */
-    //private static var staticTextFlowFactory:TextFlowTextLineFactory;
+    private static var staticTextFlowFactory:TextFlowTextLineFactory;
     
     /**
      *  @private
      *  This TLF object is used to import a 'text' String
      *  containing linebreaks to create a multiparagraph TextFlow.
      */
-    //private static var staticPlainTextImporter:ITextImporter;
+    private static var staticPlainTextImporter:ITextImporter;
     
     /**
      *  @private
@@ -295,24 +296,28 @@ public class RichText extends TextBase
      *  By doing so, we avoid any static initialization issues
      *  related to whether this class or the TLF classes
      *  that it uses are initialized first.
+     */
     private static function initClass():void
     {
         if (classInitialized)
             return;
-            
+
+        if (!TLFFactory.defaultTLFFactory)
+            TLFFactory.defaultTLFFactory = new StandardTLFFactory();        
+
         // Set the TLF hook used for localizing runtime error messages.
         // TLF itself has English-only messages,
         // but higher layers like Flex can provide localized versions.
-        GlobalSettings.resourceStringFunction = TextUtil.getResourceString;
+        //GlobalSettings.resourceStringFunction = TextUtil.getResourceString;
 
         // Set the TLF hook used to specify the callback used for changing 
         // the FontLookup based on SWFContext.  
-        GlobalSettings.resolveFontLookupFunction = TextUtil.resolveFontLookup;
+        //GlobalSettings.resolveFontLookupFunction = TextUtil.resolveFontLookup;
 
         // Pre-FP10.1, set default tab stops in TLF.  Without this, if there
         // is a tab and TLF is measuring width, the tab will
         // measure as the rest of the remaining width up to 10000.
-        GlobalSettings.enableDefaultTabStops = !Configuration.playerEnablesArgoFeatures;
+        //GlobalSettings.enableDefaultTabStops = !Configuration.playerEnablesArgoFeatures;
         
         staticStringFactory = new StringTextLineFactory();
         
@@ -321,12 +326,11 @@ public class RichText extends TextBase
         staticPlainTextImporter =
             TextConverter.getImporter(TextConverter.PLAIN_TEXT_FORMAT);
         
-        staticPlainTextExporter =
-            TextConverter.getExporter(TextConverter.PLAIN_TEXT_FORMAT);
+        //staticPlainTextExporter =
+        //    TextConverter.getExporter(TextConverter.PLAIN_TEXT_FORMAT);
             
         classInitialized = true;
     }
-     */
     
     //--------------------------------------------------------------------------
     //
@@ -346,11 +350,40 @@ public class RichText extends TextBase
     {
         super();
         
-//        initClass();
+        initClass();
         
         text = "";
+        
+        addEventListener("sizeChanged", sizeChangedHandler);
     }
-     
+    
+    private function sizeChangedHandler(event:Event):void
+    {
+        updateDisplayList(width, height);
+    }
+    
+    COMPILE::JS
+    override public function setActualSize(w:Number, h:Number):void
+    {
+        setWidthAndHeight(w, h);
+    }
+    
+    COMPILE::JS
+    override protected function createElement():WrappedHTMLElement
+    {
+        addElementToWrapper(this,'div');
+                
+        return element;
+    }
+
+    override public function addedToParent():void
+    {
+        super.addedToParent();
+        commitProperties();
+        if (isWidthSizedToContent() && isHeightSizedToContent())
+            updateDisplayList(getExplicitOrMeasuredWidth(), getExplicitOrMeasuredHeight());
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Variables
@@ -364,7 +397,7 @@ public class RichText extends TextBase
      *  It is set to null by stylesInitialized() and styleChanged(),
      *  and recreated whenever necessary in commitProperties().
      */
-    //private var hostFormat:ITextLayoutFormat;
+    private var hostFormat:ITextLayoutFormat;
 
     /**
      *  @private
@@ -372,7 +405,7 @@ public class RichText extends TextBase
      *  Used to determine whether to return immediately from damage event if 
      *  there have been no changes.
      */
-    //private var lastGeneration:uint = 0;    // 0 means not set
+    private var lastGeneration:uint = 0;    // 0 means not set
         
     /**
      *  @private
@@ -390,13 +423,13 @@ public class RichText extends TextBase
      *  and when 'text' is set to a string without linebreaks;
      *  otherwise, a TextFlowTextLineFactory is used.
      */
-    //private var factory:TextLineFactoryBase;
+    private var factory:TextLineFactoryBase;
 
     /**
      *  @private
      *  If true, the damage handler will return immediately.
      */
-    //private var ignoreDamageEvent:Boolean;
+    private var ignoreDamageEvent:Boolean;
     
     //--------------------------------------------------------------------------
     //
@@ -487,7 +520,6 @@ public class RichText extends TextBase
         textChanged = true;
         source = "text";
         
-        /*
         // If more than one of 'text', 'textFlow', and 'content' is set,
         // the last one set wins.
         textFlowChanged = false;
@@ -502,6 +534,7 @@ public class RichText extends TextBase
         
         factory = staticStringFactory;
         
+        /*
         invalidateTextLines();
         invalidateProperties();
         invalidateSize();
@@ -615,15 +648,15 @@ public class RichText extends TextBase
         textFlowChanged = false;
         
         // If there was a textFlow remove its damage handler.
-        //removeDamageHandler();
+        removeDamageHandler();
 
         // The other two are now invalid and must be recalculated when needed.
         _text = null;
         _textFlow = null;
         
-        /*
         factory = staticTextFlowFactory;
         
+        /*
         invalidateTextLines();
         invalidateProperties();
         invalidateSize();
@@ -877,7 +910,7 @@ public class RichText extends TextBase
      *  @private
      *  Storage for the textFlow property.
      */
-    private var _textFlow:String // TextFlow;
+    private var _textFlow:TextFlow;
     
     /**
      *  @private
@@ -928,7 +961,7 @@ public class RichText extends TextBase
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    public function get textFlow():String //TextFlow
+    public function get textFlow():TextFlow
     {
         // We might not have a valid _textFlow for two reasons:
         // either because the 'text' was set (which is the state
@@ -962,7 +995,7 @@ public class RichText extends TextBase
     /**
      *  @private
      */
-    public function set textFlow(value:String /*TextFlow*/):void
+    public function set textFlow(value:TextFlow):void
     {
         // Treat setting the 'textFlow' to null
         // as if 'text' were being set to the empty String
@@ -977,7 +1010,7 @@ public class RichText extends TextBase
             return;
                     
         // If there was a textFlow remove its damage handler.
-        //removeDamageHandler();
+        removeDamageHandler();
         
         _textFlow = value;
         textFlowChanged = true;
@@ -1010,9 +1043,12 @@ public class RichText extends TextBase
     
     /**
      *  @private
+     */
     override protected function commitProperties():void
     {
+        /*
         super.commitProperties();
+        */
         
         // Only one of textChanged, textFlowChanged, and contentChanged
         // will be true; the other two will be false because each setter
@@ -1027,7 +1063,7 @@ public class RichText extends TextBase
             // and FTE performance will degrade on a large paragraph.
             if (_text.indexOf("\n") != -1 || _text.indexOf("\r") != -1)
             {
-                _textFlow = staticPlainTextImporter.importToFlow(_text);
+                _textFlow = staticPlainTextImporter.importToFlow(_text) as TextFlow;
                 factory = staticTextFlowFactory;
             }
             textChanged = false;
@@ -1072,6 +1108,7 @@ public class RichText extends TextBase
                                        textFlow_damageHandler);
         }
         
+        /*
         if (maskChanged)
         {
             if (mask && !mask.parent)
@@ -1097,8 +1134,8 @@ public class RichText extends TextBase
 
             maskTypeChanged = false;
         }
+        */
     }
-         */
 
     /**
      *  @private
@@ -1131,9 +1168,11 @@ public class RichText extends TextBase
 
     /**
      *  @private
+     */
     override protected function updateDisplayList(unscaledWidth:Number, 
                                                   unscaledHeight:Number):void
     {
+        /*
         // The factory will compose just enough lines to fill the 
         // compositionHeight.  If not all the text is composed, the reported
         // contentHeight will be an estimate of what the height will be when
@@ -1146,8 +1185,15 @@ public class RichText extends TextBase
         }
 
         super.updateDisplayList(unscaledWidth, unscaledHeight);
-    }    
-     */
+        */
+        
+        // Compose will add the new text lines to the display object container.
+        // Otherwise, if the text is in a shared container, make sure the 
+        // position of the lines has remained the same.
+        TLFFactory.defaultTLFFactory.currentContainer = this;
+        composeTextLines(unscaledWidth, unscaledHeight);
+
+    }
     
     //--------------------------------------------------------------------------
     //
@@ -1158,6 +1204,7 @@ public class RichText extends TextBase
     /**
      *  @private
      *  Returns true to indicate all lines were composed.
+     */
     override mx_internal function composeTextLines(width:Number = NaN,
                                                    height:Number = NaN):Boolean
     {   
@@ -1194,7 +1241,7 @@ public class RichText extends TextBase
         // toFit.  So if we are measuring, create the text lines to figure
         // out their size and then recreate them using this size so truncation 
         // will be done.
-        if (maxDisplayedLines != 0 && !isTruncated &&
+        if (maxDisplayedLines != 0 && /*!isTruncated &&*/
             getStyle("lineBreak") == "toFit")
         {
             var bp:String = getStyle("blockProgression");
@@ -1210,10 +1257,10 @@ public class RichText extends TextBase
         addTextLines();
         
         // Figure out if the text overruns the available space for composition.
-        isOverset = isTextOverset(width, height);
+        //isOverset = isTextOverset(width, height);
         
         // Just recomposed so reset.
-        invalidateCompose = false;
+        //invalidateCompose = false;
         
         // Listen for "damage" events in case the textFlow is 
         // modified programatically.
@@ -1222,7 +1269,6 @@ public class RichText extends TextBase
         // Created all lines.
         return true;      
     }
-     */
     
     //--------------------------------------------------------------------------
     //
@@ -1232,6 +1278,7 @@ public class RichText extends TextBase
 
     /**
      *  @private
+     */
     private function createTextFlowFromContent(content:Object):TextFlow
     {
         var textFlow:TextFlow ;
@@ -1242,14 +1289,14 @@ public class RichText extends TextBase
         }
         else if (content is Array)
         {
-            textFlow = new TextFlow();
+            textFlow = new TextFlow(TLFFactory.defaultTLFFactory);
             textFlow.whiteSpaceCollapse = getStyle("whiteSpaceCollapse");
             textFlow.mxmlChildren = content as Array;
             textFlow.whiteSpaceCollapse = undefined;
         }
         else
         {
-            textFlow = new TextFlow();
+            textFlow = new TextFlow(TLFFactory.defaultTLFFactory);
             textFlow.whiteSpaceCollapse = getStyle("whiteSpaceCollapse");
             textFlow.mxmlChildren = [ content ];
             textFlow.whiteSpaceCollapse = undefined;
@@ -1257,12 +1304,12 @@ public class RichText extends TextBase
         
         return textFlow;
     }
-     */
     
     /**
      *  @private
      *  Uses TextLineFactory to compose the textFlow
      *  into as many TextLines as fit into the bounds.
+     */
     private function createTextLines():void
     {
         // Clear any previously generated TextLines from the textLines Array.
@@ -1278,6 +1325,7 @@ public class RichText extends TextBase
         factory.compositionBounds = bounds;   
         
         // Set up the truncation options.
+        /*
         var truncationOptions:TruncationOptions;
         if (maxDisplayedLines != 0)
         {
@@ -1287,37 +1335,37 @@ public class RichText extends TextBase
                 TextBase.truncationIndicatorResource;
         }        
         factory.truncationOptions = truncationOptions;
+        */
         
         // If the CSS styles for this component specify an embedded font,
         // embeddedFontContext will be set to the module factory that
         // should create TextLines (since they must be created in the
         // SWF where the embedded font is). Otherwise, this will be null.
-        embeddedFontContext = getEmbeddedFontContext();
+        //embeddedFontContext = getEmbeddedFontContext();
        
         if (factory is StringTextLineFactory)
         {
             // We know text is non-null since it got this far.
             staticStringFactory.text = _text;
             staticStringFactory.textFlowFormat = hostFormat;
-            staticStringFactory.swfContext = ISWFContext(embeddedFontContext);
+            //staticStringFactory.swfContext = ISWFContext(embeddedFontContext);
             staticStringFactory.createTextLines(addTextLine);
         }
         else if (factory is TextFlowTextLineFactory)
         {
             if (_textFlow && _textFlow.flowComposer)
             {
-                _textFlow.flowComposer.swfContext = 
-                    ISWFContext(embeddedFontContext);
+                //_textFlow.flowComposer.swfContext = 
+                //    ISWFContext(embeddedFontContext);
             }
             
-            staticTextFlowFactory.swfContext = ISWFContext(embeddedFontContext);
+            //staticTextFlowFactory.swfContext = ISWFContext(embeddedFontContext);
             staticTextFlowFactory.createTextLines(addTextLine, _textFlow);
         }
         
         bounds = factory.getContentBounds();
-        setIsTruncated(factory.isTruncated);
+        //setIsTruncated(factory.isTruncated);
     }
-     */
 
     /**
      *  @private
@@ -1358,15 +1406,16 @@ public class RichText extends TextBase
     /**
      *  @private
      *  Callback passed to createTextLines().
-    private function addTextLine(textLine:DisplayObject):void
+     */
+    private function addTextLine(textLine:ITextLine):void
     {
         textLines.push(textLine);
     }
-     */
 
     /**
      *  @private
      *  Make sure to remove the damage handler before resetting the text flow.
+     */
     private function removeDamageHandler():void
     {
         // Could check factory is TextFlowTextLineFactory but be safe and 
@@ -1377,7 +1426,6 @@ public class RichText extends TextBase
                 textFlow_damageHandler);
         }
     }
-     */
 
     //--------------------------------------------------------------------------
     //
@@ -1390,6 +1438,7 @@ public class RichText extends TextBase
      *  Called when the TextFlow dispatches a 'damage' event
      *  to indicate it has been modified.  This could mean the styles changed
      *  or the content changed, or both changed.
+     */
     private function textFlow_damageHandler(event:DamageEvent):void
     {
         // If there are no changes to the generation, don't recompose.  
@@ -1410,18 +1459,17 @@ public class RichText extends TextBase
         factory = staticTextFlowFactory;
         
         // Force recompose since text and/or styles may have changed.
-        invalidateTextLines();
+        //invalidateTextLines();
         
         // We don't need to call invalidateProperties()
         // because the hostFormat and the _textFlow are still valid.
 
         // This is smart enough not to remeasure if the explicit width/height
         // were specified.
-        invalidateSize();
+        //invalidateSize();
         
-        invalidateDisplayList();  
+        //invalidateDisplayList();  
     }    
-     */
 }
 
 }
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/TextBase.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/TextBase.as
index 43297a3..685cf0b 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/TextBase.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/TextBase.as
@@ -20,14 +20,16 @@
 package spark.components.supportClasses
 {
 
-/* import flash.display.DisplayObject;
+import org.apache.royale.geom.Rectangle;
+COMPILE::SWF
+{
+    import flash.display.DisplayObject;      
+}
+/*
 import flash.display.Graphics;
 import flash.display.Shape;
 import flash.events.Event;
-import flash.geom.Rectangle;
 import flash.text.engine.FontLookup;
-import flash.text.engine.TextLine;
-import flash.text.engine.TextLineValidity;
 
 import mx.core.IFlexModuleFactory;
 
@@ -37,7 +39,7 @@ import mx.resources.ResourceManager;
 import spark.core.IDisplayText;
 import spark.utils.TextUtil;
 
-import flashx.textLayout.compose.TextLineRecycler; */
+*/
 import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
@@ -51,6 +53,10 @@ COMPILE::JS
     import org.apache.royale.html.util.addElementToWrapper;
     import org.apache.royale.core.WrappedHTMLElement;
 }
+import org.apache.royale.text.html.TextLine;
+import org.apache.royale.text.engine.ITextLine;
+import org.apache.royale.text.engine.TextLineValidity;
+import org.apache.royale.textLayout.compose.TextLineRecycler;
 import org.apache.royale.core.ITextModel;
 
 use namespace mx_internal;
@@ -201,16 +207,15 @@ public class TextBase extends UIComponent
      *  @private
      *  The composition bounds used when creating the TextLines.
      */
-   // mx_internal var bounds:Rectangle = new Rectangle(0, 0, NaN, NaN);
+    mx_internal var bounds:Rectangle = new Rectangle(0, 0, NaN, NaN);
 
     /**
      *  @private
 	 *  The TextLines and Shapes created to render the text.
 	 *  (Shapes are used to render the backgroundColor format for RichText.)
      */
-   /*  mx_internal var textLines:Vector.<DisplayObject> =
-    	new Vector.<DisplayObject>();
- */
+    mx_internal var textLines:Array = []; //Vector.<DisplayObject> = new Vector.<DisplayObject>();
+ 
     /**
      *  @private
      *  This flag is set to true if the text must be clipped.
@@ -236,13 +241,13 @@ public class TextBase extends UIComponent
      *  @private
      *  The value of bounds.width, before the compose was done.
      */
-  //  mx_internal var _composeWidth:Number;
+    mx_internal var _composeWidth:Number;
 
     /**
      *  @private
      *  The value of bounds.height, before the compose was done.
      */
-   // mx_internal var _composeHeight:Number;
+    mx_internal var _composeHeight:Number;
     
     /**
      *  @private
@@ -949,22 +954,24 @@ public class TextBase extends UIComponent
      *  @private
      *  Returns false to indicate no lines were composed.
      */
-    /* mx_internal function composeTextLines(width:Number = NaN,
+    mx_internal function composeTextLines(width:Number = NaN,
 										height:Number = NaN):Boolean
 	{
 	    _composeWidth = width;
 	    _composeHeight = height;
-	    
+	 
+        /*
 	    setIsTruncated(false);
+        */
 	    
 	    return false;
-	} */
+	}
 
 	/**
 	 *  @private
 	 *  Adds the TextLines created by composeTextLines() to this container.
 	 */
-	/* mx_internal function addTextLines():void
+	mx_internal function addTextLines():void
 	{
 		var n:int = textLines.length;
         if (n == 0)
@@ -972,11 +979,18 @@ public class TextBase extends UIComponent
 
         for (var i:int = n - 1; i >= 0; i--)
         {
-            var textLine:DisplayObject = textLines[i];		
+            var textLine:ITextLine = textLines[i];
             // Add new TextLine accounting for our background Shape.
-            $addChildAt(textLine, 1);
+            COMPILE::SWF
+            {
+                $addChildAt(textLine as DisplayObject, 1);
+            }
+            COMPILE::JS
+            {
+                addElementAt(textLine, 1);
+            }
         }
-	} */
+	}
 
 	/**
 	 *  @private
@@ -985,7 +999,7 @@ public class TextBase extends UIComponent
      * 
 	 *  This does not empty the textLines Array.
 	 */
-	/* mx_internal function removeTextLines():void
+	mx_internal function removeTextLines():void
 	{
 		var n:int = textLines.length;		
 		if (n == 0)
@@ -993,19 +1007,28 @@ public class TextBase extends UIComponent
 
 		for (var i:int = 0; i < n; i++)
 		{
-			var textLine:DisplayObject = textLines[i];	
+			var textLine:ITextLine = textLines[i];	
             var parent:UIComponent = textLine.parent as UIComponent;
             if (parent)
-                UIComponent(textLine.parent).$removeChild(textLine);
+            {
+                COMPILE::SWF
+                {
+                    UIComponent(textLine.parent).$removeChild(textLine as DisplayObject);                        
+                }
+                COMPILE::JS
+                {
+                    UIComponent(textLine.parent).removeElement(textLine);                        
+                }
+            }
 		}
-	} */
+	}
 
     /**
      *  @private
      *  Adds the TextLines to the reuse cache, and clears the textLines array.
      */
-    /* mx_internal function releaseTextLines(
-    	textLinesVector:Vector.<DisplayObject> = null):void
+    mx_internal function releaseTextLines(
+    	textLinesVector:Array = null):void
     {
         if (!textLinesVector)
             textLinesVector = textLines;
@@ -1030,7 +1053,7 @@ public class TextBase extends UIComponent
         }
         
         textLinesVector.length = 0;
-   } */
+   }
     
     /**
      *  @private
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/core/CSSTextLayoutFormat.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/core/CSSTextLayoutFormat.as
new file mode 100644
index 0000000..c7db0ba
--- /dev/null
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/core/CSSTextLayoutFormat.as
@@ -0,0 +1,153 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.core
+{
+    
+    import org.apache.royale.text.engine.FontLookup;
+    import org.apache.royale.text.engine.Kerning;
+    import org.apache.royale.textLayout.formats.TextLayoutFormat;
+    import org.apache.royale.textLayout.property.Property;
+    //import org.apache.royale.textLayout.tlf_internal;
+    import mx.core.mx_internal;
+    import mx.styles.IStyleClient;
+    
+    [ExcludeClass]
+    
+    /**
+     *  @private
+     *  This class is used by components such as RichText
+     *  and RichEditableText which use TLF to display their text.
+     *  The default formatting for their text is determined
+     *  by the component's CSS styles.
+     *
+     *  TLF recognizes the copy that is done in this constructor and does not
+     *  do another one. If TLF adds formats to TextLayoutFormats this should
+     *  continue to work as long as Flex doesn't want some alterate behavior.
+     *
+     *  The only extra functionality supported here, beyond what TLF has,
+     *  is the ability for the fontLookup style to have the value "auto";
+     *  in this case, the client object's embeddedFontContext is used
+     *  to determine whether the the fontLookup format in TLF should be
+     *  "embeddedCFF" or "device".
+     */
+    public class CSSTextLayoutFormat extends TextLayoutFormat
+    {
+//        include "../core/Version.as";
+        
+        //--------------------------------------------------------------------------
+        //
+        //  Constructor
+        //
+        //--------------------------------------------------------------------------
+        
+        /**
+         *  @private
+         *  Constructor
+         */
+        public function CSSTextLayoutFormat(client:IStyleClient)
+        {
+            super();
+            
+            for each (var prop:Property in TextLayoutFormat.description)
+            {
+                const propName:String = prop.name;
+                if (propName == "fontLookup")
+                {
+                    this[propName] = convertedFontLookup(client);
+                }
+                else if (propName == "kerning")
+                {
+                    this[propName] = convertedKerning(client);
+                }
+                else
+                {
+                    const value:* = client.getStyle(propName);
+                    if (value !== undefined)
+                        this[propName] = value;
+                }
+            }		
+        }
+        
+        
+        /**
+         *  @private
+         */
+        private static function convertedFontLookup(client:IStyleClient):*
+        {
+            var value:String = client.getStyle("fontLookup");
+            
+            // Special processing of the "auto" value is required,
+            // because this value has meaning only in Flex, not in TLF.
+            // It tells Flex to use its EmbeddedFontRegistry to determine
+            // whether the font is embedded or not.
+            if (value == "auto")
+            {
+                if (client.mx_internal::embeddedFontContext)
+                    value = FontLookup.EMBEDDED_CFF;
+                else
+                    value = FontLookup.DEVICE;
+            }
+            
+            return value;
+        }
+        
+        
+        /**
+         *  @private
+         */
+        private static function convertedKerning(client:IStyleClient):*
+        {
+            var kerning:Object = client.getStyle("kerning");
+            
+            // In Halo components based on TextField,
+            // kerning is supposed to be true or false.
+            // The default in TextField and Flex 3 is false
+            // because kerning doesn't work for device fonts
+            // and is slow for embedded fonts.
+            // In Spark components based on TLF and FTE,
+            // kerning is "auto", "on", or, "off".
+            // The default in TLF and FTE is "auto"
+            // (which means kern non-Asian characters)
+            // because kerning works even on device fonts
+            // and has miminal performance impact.
+            // Since a CSS selector or parent container
+            // can affect both Halo and Spark components,
+            // we need to map true to "on" and false to "off"
+            // here and in Label.
+            // For Halo components, UITextField and UIFTETextField
+            // do the opposite mapping
+            // of "auto" and "on" to true and "off" to false.
+            // We also support a value of "default"
+            // (which we set in the global selector)
+            // to mean "auto" for Spark and false for Halo
+            // to get the recommended behavior in both sets of components.
+            if (kerning === "default")
+                kerning = Kerning.AUTO;
+            else if (kerning === true)
+                kerning = Kerning.ON;
+            else if (kerning === false)
+                kerning = Kerning.OFF;
+            
+            return kerning;
+        }
+    }
+    
+}
+


[royale-asjs] 01/07: add scale properties to format. multiparagraph textflows seemed to fail calculating leading

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit ca8c17cbde5281154d200df94770d44b8b1a0026
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Aug 13 23:23:44 2018 -0700

    add scale properties to format.  multiparagraph textflows seemed to fail calculating leading
---
 .../royale/org/apache/royale/textLayout/formats/TextLayoutFormat.as     | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/formats/TextLayoutFormat.as b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/formats/TextLayoutFormat.as
index 4017fc9..868a020 100644
--- a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/formats/TextLayoutFormat.as
+++ b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/formats/TextLayoutFormat.as
@@ -987,6 +987,8 @@ package org.apache.royale.textLayout.formats
 					, textAlpha:textAlphaProperty
 					, backgroundAlpha:backgroundAlphaProperty
 					, fontSize:fontSizeProperty
+                    , xScale:xScaleProperty
+                    , yScale:yScaleProperty
 					, baselineShift:baselineShiftProperty
 					, trackingLeft:trackingLeftProperty
 					, trackingRight:trackingRightProperty


[royale-asjs] 07/07: switch to using just 'padding' so it doesn't overrule other padding. The CSS lookup may need to be smarter about rule precedence

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 85931a20c42ea30f08bb399b3e7aaa9bde3f8090
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Aug 14 00:57:52 2018 -0700

    switch to using just 'padding' so it doesn't overrule other padding.  The CSS lookup may need to be smarter about rule precedence
---
 .../projects/MXRoyale/src/main/resources/defaults.css     | 15 ++++++---------
 .../src/main/royale/mx/containers/beads/BoxLayout.as      |  8 ++++++--
 .../MXRoyale/src/main/royale/mx/core/Container.as         |  9 +++++----
 3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index 07a934d..96e3558 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -28,21 +28,18 @@
 * {
 	font-family:	Verdana;
 	font-size:		12px;
-    whiteSpaceCollapse: "collapse";
-	horizontalAlign: "left";
-	horizontalGap: 8;
-	verticalAlign: "top";
-	verticalGap: 6;
-    padding-bottom: 0;
-	padding-left: 0;
-	padding-right: 0;
-	padding-top: 0;
 
 }
 
 global {
     IStatesImpl:            ClassReference("org.apache.royale.core.StatesWithTransitionsImpl");
 	IEffectTimer: 			ClassReference("org.apache.royale.utils.EffectTimer");
+    whiteSpaceCollapse: "collapse";
+	horizontalAlign: "left";
+	horizontalGap: 8;
+	verticalAlign: "top";
+	verticalGap: 6;
+    padding : 0px;
 }
 
 /* -------------------------------------------------------
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as
index 0c2f6a9..fac8e12 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as
@@ -27,9 +27,12 @@ package mx.containers.beads
 	import mx.core.EdgeMetrics;
 	import mx.core.IUIComponent;
 	
+    import org.apache.royale.core.IBorderPaddingMarginValuesImpl;
 	import org.apache.royale.core.IStrand;
 	import org.apache.royale.core.LayoutBase;
 	import org.apache.royale.core.UIBase;
+    import org.apache.royale.core.layout.EdgeData;
+	import org.apache.royale.core.ValuesManager;
 
 	//import mx.core.mx_internal;
 	//import mx.core.ScrollPolicy;
@@ -221,9 +224,10 @@ package mx.containers.beads
 			if (n == 0) return;
 			
 			var vm:EdgeMetrics = target.viewMetricsAndPadding;
+            var pd:EdgeData = (ValuesManager.valuesImpl as IBorderPaddingMarginValuesImpl).getPaddingMetrics(target);
 			
-			var paddingLeft:Number = target.getStyle("paddingLeft");
-			var paddingTop:Number = target.getStyle("paddingTop");
+			var paddingLeft:Number = pd.left;
+			var paddingTop:Number = pd.top;
 			
 			var horizontalAlign:Number = getHorizontalAlignValue();
 			var verticalAlign:Number = getVerticalAlignValue();
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
index bef4300..e9f3ea6 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
@@ -852,11 +852,12 @@ public class Container extends UIComponent
 		var o:EdgeMetrics = _viewMetricsAndPadding;
 		var ed:EdgeData = (ValuesManager.valuesImpl as IBorderPaddingMarginValuesImpl).getBorderMetrics(this);
         var vm:EdgeMetrics = new EdgeMetrics(ed.left, ed.top, ed.right, ed.bottom);
+        var pd:EdgeData = (ValuesManager.valuesImpl as IBorderPaddingMarginValuesImpl).getPaddingMetrics(this);
 		
-		o.left = vm.left + getStyle("paddingLeft");
-		o.right = vm.right + getStyle("paddingRight");
-		o.top = vm.top + getStyle("paddingTop");
-		o.bottom = vm.bottom + getStyle("paddingBottom");
+		o.left = vm.left + pd.left;
+		o.right = vm.right + pd.right;
+		o.top = vm.top + pd.top;
+		o.bottom = vm.bottom + pd.bottom;
 		
 		return o;
 	}


[royale-asjs] 03/07: set some default styles for TLF

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit af65a24f2fbbada3769a9494ffc77d999d7aa01d
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Aug 13 23:27:36 2018 -0700

    set some default styles for TLF
---
 frameworks/projects/MXRoyale/src/main/resources/defaults.css | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index cef992c..07a934d 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -28,6 +28,16 @@
 * {
 	font-family:	Verdana;
 	font-size:		12px;
+    whiteSpaceCollapse: "collapse";
+	horizontalAlign: "left";
+	horizontalGap: 8;
+	verticalAlign: "top";
+	verticalGap: 6;
+    padding-bottom: 0;
+	padding-left: 0;
+	padding-right: 0;
+	padding-top: 0;
+
 }
 
 global {