-
-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add avm2/edittext_empty_text_format test
This test verifies the text format of empty text. It is observable in empty input text fields, because they have to show the caret.
- Loading branch information
Showing
5 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
15 | ||
8 | ||
2 | ||
15 | ||
5 | ||
0 | ||
2 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
num_ticks = 1 |