diff --git a/tests/tests/swfs/avm2/edittext_bullet_font/Test.as b/tests/tests/swfs/avm2/edittext_bullet_font/Test.as new file mode 100644 index 000000000000..777837686ef7 --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_bullet_font/Test.as @@ -0,0 +1,47 @@ +package { +import flash.display.Sprite; +import flash.text.TextField; +import flash.text.TextFormat; + +[SWF(width="200", height="200")] +public class Test extends Sprite { + [Embed(source="TestFontBulletA.ttf", fontName="TestFontNoBullet", embedAsCFF="false", unicodeRange="U+0061-U+0064")] + private var TestFontNoBullet:Class; + + [Embed(source="TestFontBulletA.ttf", fontName="TestFontBulletA", embedAsCFF="false", unicodeRange="U+0061-U+0064,U+2022")] + private var TestFontBulletA:Class; + + [Embed(source="TestFontBulletB.ttf", fontName="TestFontBulletB", embedAsCFF="false", unicodeRange="U+0061-U+0064,U+2022")] + private var TestFontBulletB:Class; + + public function Test() { + stage.scaleMode = "noScale"; + + newTextField(5, 5, "TestFontBulletA", "
  • a
  • "); + newTextField(5, 55, "TestFontBulletA", "
  • a
  • "); + newTextField(5, 105, "TestFontBulletA", "
  • a
  • "); + newTextField(5, 155, "TestFontBulletA", "
  • aa
  • "); + newTextField(105, 5, "TestFontBulletA", "
  • aa
  • "); + newTextField(105, 55, "TestFontBulletA", "
  • a
  • "); + newTextField(105, 105, "TestFontBulletA", "
  • aa
  • "); + newTextField(105, 155, "TestFontBulletA", "
  • aa
  • "); + } + + private function newTextField(x: int, y: int, defaultFont: String, htmlText: String):void { + var text = new TextField(); + text.border = true; + text.x = x; + text.y = y; + text.width = 90; + text.height = 40; + text.embedFonts = true; + var tf = new TextFormat(); + tf.font = defaultFont; + tf.size = 20; + tf.leading = 5; + text.defaultTextFormat = tf; + text.htmlText = htmlText; + addChild(text); + } +} +} diff --git a/tests/tests/swfs/avm2/edittext_bullet_font/TestFontBulletA.sfd b/tests/tests/swfs/avm2/edittext_bullet_font/TestFontBulletA.sfd new file mode 100644 index 000000000000..de2cf270622e --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_bullet_font/TestFontBulletA.sfd @@ -0,0 +1,134 @@ +SplineFontDB: 3.2 +FontName: TestFontBulletA +FullName: TestFontBulletA +FamilyName: TestFontBulletA +Weight: Regular +Copyright: Copyright (c) 2024, Kamil Jarosz +UComments: "2024-7-24: Created with FontForge (http://fontforge.org)" +Version: 001.000 +ItalicAngle: 0 +UnderlinePosition: -76 +UnderlineWidth: 38 +Ascent: 800 +Descent: 200 +InvalidEm: 0 +LayerCount: 2 +Layer: 0 0 "Back" 1 +Layer: 1 0 "Fore" 0 +XUID: [1021 253 198287149 6396829] +StyleMap: 0x0000 +FSType: 0 +OS2Version: 0 +OS2_WeightWidthSlopeOnly: 0 +OS2_UseTypoMetrics: 1 +CreationTime: 1721856925 +ModificationTime: 1732996340 +PfmFamily: 17 +TTFWeight: 400 +TTFWidth: 5 +LineGap: 100 +VLineGap: 0 +OS2TypoAscent: 0 +OS2TypoAOffset: 1 +OS2TypoDescent: 0 +OS2TypoDOffset: 1 +OS2TypoLinegap: 100 +OS2WinAscent: 0 +OS2WinAOffset: 1 +OS2WinDescent: 0 +OS2WinDOffset: 1 +HheadAscent: 0 +HheadAOffset: 1 +HheadDescent: 0 +HheadDOffset: 1 +OS2Vendor: 'PfEd' +MarkAttachClasses: 1 +DEI: 91125 +Encoding: UnicodeBmp +UnicodeInterp: none +NameList: AGL For New Fonts +DisplaySize: -48 +AntiAlias: 1 +FitToEm: 0 +WinInfo: 8190 30 10 +BeginPrivate: 0 +EndPrivate +BeginChars: 65536 5 + +StartChar: a +Encoding: 97 97 0 +Width: 800 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 800 m 5 + 800 800 l 5 + 800 0 l 1 + 0 0 l 1 + 0 800 l 5 +EndSplineSet +EndChar + +StartChar: b +Encoding: 98 98 1 +Width: 108 +VWidth: 1083 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 800 m 5 + 108 800 l 5 + 108 0 l 1 + 0 0 l 1 + 0 800 l 5 +EndSplineSet +EndChar + +StartChar: c +Encoding: 99 99 2 +Width: 800 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 0 m 1 + 800 0 l 1 + 800 -200 l 5 + 0 -200 l 5 + 0 0 l 1 +EndSplineSet +EndChar + +StartChar: d +Encoding: 100 100 3 +Width: 100 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 0 m 1 + 100 0 l 1 + 100 -200 l 5 + 0 -200 l 5 + 0 0 l 1 +EndSplineSet +EndChar + +StartChar: bullet +Encoding: 8226 8226 4 +Width: 800 +Flags: HW +LayerCount: 2 +Fore +SplineSet +100 700 m 1 + 700 700 l 1 + 700 100 l 5 + 100 100 l 5 + 100 700 l 1 +EndSplineSet +EndChar +EndChars +EndSplineFont diff --git a/tests/tests/swfs/avm2/edittext_bullet_font/TestFontBulletA.ttf b/tests/tests/swfs/avm2/edittext_bullet_font/TestFontBulletA.ttf new file mode 100644 index 000000000000..1bfcf30314c9 Binary files /dev/null and b/tests/tests/swfs/avm2/edittext_bullet_font/TestFontBulletA.ttf differ diff --git a/tests/tests/swfs/avm2/edittext_bullet_font/TestFontBulletB.sfd b/tests/tests/swfs/avm2/edittext_bullet_font/TestFontBulletB.sfd new file mode 100644 index 000000000000..58c8a5ae72c6 --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_bullet_font/TestFontBulletB.sfd @@ -0,0 +1,139 @@ +SplineFontDB: 3.2 +FontName: TestFontBulletB +FullName: TestFontBulletB +FamilyName: TestFontBulletB +Weight: Regular +Copyright: Copyright (c) 2024, Kamil Jarosz +UComments: "2024-7-24: Created with FontForge (http://fontforge.org)" +Version: 001.000 +ItalicAngle: 0 +UnderlinePosition: -76 +UnderlineWidth: 38 +Ascent: 800 +Descent: 200 +InvalidEm: 0 +LayerCount: 2 +Layer: 0 0 "Back" 1 +Layer: 1 0 "Fore" 0 +XUID: [1021 253 198287149 6396829] +StyleMap: 0x0000 +FSType: 0 +OS2Version: 0 +OS2_WeightWidthSlopeOnly: 0 +OS2_UseTypoMetrics: 1 +CreationTime: 1721856925 +ModificationTime: 1732996414 +PfmFamily: 17 +TTFWeight: 400 +TTFWidth: 5 +LineGap: 100 +VLineGap: 0 +OS2TypoAscent: 0 +OS2TypoAOffset: 1 +OS2TypoDescent: 0 +OS2TypoDOffset: 1 +OS2TypoLinegap: 100 +OS2WinAscent: 0 +OS2WinAOffset: 1 +OS2WinDescent: 0 +OS2WinDOffset: 1 +HheadAscent: 0 +HheadAOffset: 1 +HheadDescent: 0 +HheadDOffset: 1 +OS2Vendor: 'PfEd' +MarkAttachClasses: 1 +DEI: 91125 +Encoding: UnicodeBmp +UnicodeInterp: none +NameList: AGL For New Fonts +DisplaySize: -48 +AntiAlias: 1 +FitToEm: 0 +WinInfo: 8190 30 10 +BeginPrivate: 0 +EndPrivate +BeginChars: 65536 5 + +StartChar: a +Encoding: 97 97 0 +Width: 800 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 800 m 5 + 800 800 l 5 + 800 0 l 1 + 0 0 l 1 + 0 800 l 5 +EndSplineSet +Validated: 1 +EndChar + +StartChar: b +Encoding: 98 98 1 +Width: 108 +VWidth: 1083 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 800 m 5 + 108 800 l 5 + 108 0 l 1 + 0 0 l 1 + 0 800 l 5 +EndSplineSet +Validated: 1 +EndChar + +StartChar: c +Encoding: 99 99 2 +Width: 800 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 0 m 1 + 800 0 l 1 + 800 -200 l 5 + 0 -200 l 5 + 0 0 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: d +Encoding: 100 100 3 +Width: 100 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 0 m 1 + 100 0 l 1 + 100 -200 l 5 + 0 -200 l 5 + 0 0 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: bullet +Encoding: 8226 8226 4 +Width: 800 +Flags: HW +LayerCount: 2 +Fore +SplineSet +300 500 m 1 + 500 500 l 5 + 500 300 l 5 + 300 300 l 1 + 300 500 l 1 +EndSplineSet +Validated: 1 +EndChar +EndChars +EndSplineFont diff --git a/tests/tests/swfs/avm2/edittext_bullet_font/TestFontBulletB.ttf b/tests/tests/swfs/avm2/edittext_bullet_font/TestFontBulletB.ttf new file mode 100644 index 000000000000..c7b20dfe7caf Binary files /dev/null and b/tests/tests/swfs/avm2/edittext_bullet_font/TestFontBulletB.ttf differ diff --git a/tests/tests/swfs/avm2/edittext_bullet_font/output.expected.png b/tests/tests/swfs/avm2/edittext_bullet_font/output.expected.png new file mode 100644 index 000000000000..e4b7f68b10f1 Binary files /dev/null and b/tests/tests/swfs/avm2/edittext_bullet_font/output.expected.png differ diff --git a/tests/tests/swfs/avm2/edittext_bullet_font/output.txt b/tests/tests/swfs/avm2/edittext_bullet_font/output.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tests/swfs/avm2/edittext_bullet_font/test.swf b/tests/tests/swfs/avm2/edittext_bullet_font/test.swf new file mode 100644 index 000000000000..5a2dfe4737e9 Binary files /dev/null and b/tests/tests/swfs/avm2/edittext_bullet_font/test.swf differ diff --git a/tests/tests/swfs/avm2/edittext_bullet_font/test.toml b/tests/tests/swfs/avm2/edittext_bullet_font/test.toml new file mode 100644 index 000000000000..454b7bf7f4dc --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_bullet_font/test.toml @@ -0,0 +1,7 @@ +num_ticks = 1 + +[image_comparisons.output] +tolerance = 128 + +[player_options] +with_renderer = { optional = false, sample_count = 4 }