You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2017/05/08 18:59:19 UTC

[07/21] git commit: [flex-asjs] [refs/heads/tlf] - need FontMetrics

need FontMetrics


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/af36a261
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/af36a261
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/af36a261

Branch: refs/heads/tlf
Commit: af36a261d408329e5405d65a4a014944ec092be5
Parents: e290e6a
Author: Alex Harui <ah...@apache.org>
Authored: Sat May 6 21:36:18 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon May 8 11:59:01 2017 -0700

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/text/engine/ElementFormat.as    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/af36a261/frameworks/projects/Text/src/main/flex/org/apache/flex/text/engine/ElementFormat.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Text/src/main/flex/org/apache/flex/text/engine/ElementFormat.as b/frameworks/projects/Text/src/main/flex/org/apache/flex/text/engine/ElementFormat.as
index 3edbee5..faf9a40 100644
--- a/frameworks/projects/Text/src/main/flex/org/apache/flex/text/engine/ElementFormat.as
+++ b/frameworks/projects/Text/src/main/flex/org/apache/flex/text/engine/ElementFormat.as
@@ -18,6 +18,8 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.text.engine
 {
+	import org.apache.flex.geom.Rectangle;
+	
 	public class ElementFormat
 	{
 		public function ElementFormat()
@@ -80,7 +82,10 @@ package org.apache.flex.text.engine
  	 	
 		public function getFontMetrics():FontMetrics
 		{
-			return null;
+			var fm:FontMetrics = new FontMetrics();
+			// just a guess for now
+			fm.emBox = new Rectangle(0, 1.2 - fontSize, fontSize, 1.2);
+			return fm;
 		}
 	}
 }
\ No newline at end of file