diff --git a/tests/tests/swfs/avm2/edittext_empty_text_format/Test.as b/tests/tests/swfs/avm2/edittext_empty_text_format/Test.as new file mode 100644 index 000000000000..d058c22780f6 --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_empty_text_format/Test.as @@ -0,0 +1,30 @@ +package { +import flash.display.*; +import flash.text.*; +import flash.events.*; +import flash.geom.*; + +public class Test extends MovieClip { + [Embed(source="TestFont.ttf", fontName="TestFont", embedAsCFF="false", unicodeRange="U+0061-U+0064")] + private var TestFont:Class; + + public function Test() { + stage.scaleMode = "noScale"; + + var field = new TextField(); + var tf = new TextFormat("TestFont", 10); + tf.leading = 5; + field.defaultTextFormat = tf; + field.type = "input"; + field.embedFonts = true; + + trace(field.textHeight); + trace(field.getLineMetrics(0).ascent); + trace(field.getLineMetrics(0).descent); + trace(field.getLineMetrics(0).height); + trace(field.getLineMetrics(0).leading); + trace(field.getLineMetrics(0).width); + trace(field.getLineMetrics(0).x); + } +} +} diff --git a/tests/tests/swfs/avm2/edittext_empty_text_format/TestFont.ttf b/tests/tests/swfs/avm2/edittext_empty_text_format/TestFont.ttf new file mode 100644 index 000000000000..761128c1eb3c Binary files /dev/null and b/tests/tests/swfs/avm2/edittext_empty_text_format/TestFont.ttf differ diff --git a/tests/tests/swfs/avm2/edittext_empty_text_format/output.txt b/tests/tests/swfs/avm2/edittext_empty_text_format/output.txt new file mode 100644 index 000000000000..dc2d57c442fd --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_empty_text_format/output.txt @@ -0,0 +1,7 @@ +15 +8 +2 +15 +5 +0 +2 diff --git a/tests/tests/swfs/avm2/edittext_empty_text_format/test.swf b/tests/tests/swfs/avm2/edittext_empty_text_format/test.swf new file mode 100644 index 000000000000..de51368e7d5f Binary files /dev/null and b/tests/tests/swfs/avm2/edittext_empty_text_format/test.swf differ diff --git a/tests/tests/swfs/avm2/edittext_empty_text_format/test.toml b/tests/tests/swfs/avm2/edittext_empty_text_format/test.toml new file mode 100644 index 000000000000..cf6123969a1d --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_empty_text_format/test.toml @@ -0,0 +1 @@ +num_ticks = 1