Skip to content

Commit deab805

Browse files
committed
tests: Add edittext_gutter test
This test verifies how the gutter of a text field behaves.
1 parent 6429cc8 commit deab805

File tree

7 files changed

+166
-0
lines changed

7 files changed

+166
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package {
2+
import flash.display.Sprite;
3+
import flash.text.TextField;
4+
import flash.text.TextFormat;
5+
6+
[SWF(width="100", height="110")]
7+
public class Test extends Sprite {
8+
[Embed(source="TestFont.ttf", fontName="TestFont", embedAsCFF="false", unicodeRange="U+0061-U+0062")]
9+
private var testFont:Class;
10+
11+
private var nextX:int = 2;
12+
private var nextY:int = 2;
13+
14+
public function Test() {
15+
stage.scaleMode = "noScale";
16+
17+
newTextField("a", 0, 0);
18+
newTextField("a", 1, 0);
19+
newTextField("a", 2, 0);
20+
newTextField("a", 3, 0);
21+
newTextField("a", 4, 0);
22+
newTextField("a", 5, 0);
23+
newTextField("a", 6, 0);
24+
newTextField("a", 7, 0);
25+
newTextField("a", 8, 0);
26+
newTextField("a", 40, 0);
27+
nextY += 34;
28+
nextX = 2;
29+
30+
newTextField("b", 0, 0);
31+
newTextField("b", 1, 0);
32+
newTextField("b", 2, 0);
33+
newTextField("b", 3, 0);
34+
newTextField("b", 4, 0);
35+
newTextField("b", 5, 0);
36+
newTextField("b", 6, 0);
37+
newTextField("b", 7, 0);
38+
newTextField("b", 8, 0);
39+
newTextField("b", 40, 0);
40+
nextY += 34;
41+
nextX = 2;
42+
43+
newTextField("b", 6, 0);
44+
newTextField("b", 6, 1);
45+
newTextField("b", 6, 2);
46+
newTextField("b", 6, 3);
47+
newTextField("b", 6, 4);
48+
newTextField("b", 6, 5);
49+
newTextField("b", 6, 6);
50+
newTextField("b", 6, 18);
51+
newTextField("b", 6, 19);
52+
newTextField("b", 6, 20);
53+
newTextField("b", 6, 21);
54+
newTextField("b", 6, 22);
55+
}
56+
57+
private function newTextField(value: String, width: int, hscroll: int): void {
58+
var text:TextField = new TextField();
59+
text.border = true;
60+
text.width = width;
61+
text.x = nextX;
62+
text.y = nextY;
63+
text.height = 30;
64+
text.embedFonts = true;
65+
var tf = new TextFormat();
66+
tf.font = "TestFont";
67+
tf.size = 20;
68+
text.defaultTextFormat = tf;
69+
text.text = value;
70+
text.scrollH = hscroll;
71+
nextX += text.width + 2;
72+
addChild(text);
73+
}
74+
75+
}
76+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
SplineFontDB: 3.2
2+
FontName: TestFont
3+
FullName: TestFont
4+
FamilyName: TestFont
5+
Weight: Regular
6+
Copyright: Copyright (c) 2024, Kamil Jarosz
7+
UComments: "2024-7-24: Created with FontForge (http://fontforge.org)"
8+
Version: 001.000
9+
ItalicAngle: 0
10+
UnderlinePosition: -100
11+
UnderlineWidth: 50
12+
Ascent: 800
13+
Descent: 200
14+
InvalidEm: 0
15+
LayerCount: 2
16+
Layer: 0 0 "Back" 1
17+
Layer: 1 0 "Fore" 0
18+
XUID: [1021 253 198287149 6396829]
19+
StyleMap: 0x0000
20+
FSType: 0
21+
OS2Version: 0
22+
OS2_WeightWidthSlopeOnly: 0
23+
OS2_UseTypoMetrics: 1
24+
CreationTime: 1721856925
25+
ModificationTime: 1728902792
26+
OS2TypoAscent: 0
27+
OS2TypoAOffset: 1
28+
OS2TypoDescent: 0
29+
OS2TypoDOffset: 1
30+
OS2TypoLinegap: 90
31+
OS2WinAscent: 0
32+
OS2WinAOffset: 1
33+
OS2WinDescent: 0
34+
OS2WinDOffset: 1
35+
HheadAscent: 0
36+
HheadAOffset: 1
37+
HheadDescent: 0
38+
HheadDOffset: 1
39+
OS2Vendor: 'PfEd'
40+
MarkAttachClasses: 1
41+
DEI: 91125
42+
Encoding: ISO8859-1
43+
UnicodeInterp: none
44+
NameList: AGL For New Fonts
45+
DisplaySize: -48
46+
AntiAlias: 1
47+
FitToEm: 0
48+
WinInfo: 0 30 10
49+
BeginPrivate: 0
50+
EndPrivate
51+
BeginChars: 256 2
52+
53+
StartChar: a
54+
Encoding: 97 97 0
55+
Width: 50
56+
Flags: HW
57+
LayerCount: 2
58+
Fore
59+
SplineSet
60+
0 800 m 1
61+
50 800 l 1
62+
50 0 l 1
63+
0 0 l 1
64+
0 800 l 1
65+
EndSplineSet
66+
EndChar
67+
68+
StartChar: b
69+
Encoding: 98 98 1
70+
Width: 1000
71+
Flags: HW
72+
LayerCount: 2
73+
Fore
74+
SplineSet
75+
0 800 m 1
76+
1000 800 l 1
77+
1000 0 l 1
78+
0 0 l 1
79+
0 800 l 1
80+
EndSplineSet
81+
EndChar
82+
EndChars
83+
EndSplineFont
1.56 KB
Binary file not shown.
522 Bytes
Loading

tests/tests/swfs/visual/edittext/edittext_gutter/output.txt

Whitespace-only changes.
1.38 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
num_ticks = 1
2+
3+
[image_comparisons.output]
4+
tolerance = 128
5+
6+
[player_options]
7+
with_renderer = { optional = false, sample_count = 4 }

0 commit comments

Comments
 (0)