Add pixel test for non-ASCII text appearances

Adds a pixel test for generating non-ASCII text appearances, as seen in
text annotations and text form fields. This pixel test demonstrates that
text annotations currently behave worse than text form fields, and that
neither handles supplementary characters correctly.

Bug: pdfium:1098
Change-Id: I3990d3f4a600cbf03af872923f61e98e0443b9fa
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/107912
Commit-Queue: K. Moon <kmoon@chromium.org>
Reviewed-by: Nigi <nigi@chromium.org>
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index 623c486..222099a 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -333,6 +333,9 @@
 # Pixel tests
 #
 
+# TODO(pdfium:1098): Remove after associated bug is fixed
+bug_1098.in * * * *
+
 # TODO(chromium:1131694): Remove after associated bug is fixed
 bug_1131694.in * * * *
 
diff --git a/testing/resources/pixel/bug_1098.evt b/testing/resources/pixel/bug_1098.evt
new file mode 100644
index 0000000..0e0538b
--- /dev/null
+++ b/testing/resources/pixel/bug_1098.evt
@@ -0,0 +1,2 @@
+# Show text annotation pop-up
+mousemove,20,250
diff --git a/testing/resources/pixel/bug_1098.in b/testing/resources/pixel/bug_1098.in
new file mode 100644
index 0000000..a18aa19
--- /dev/null
+++ b/testing/resources/pixel/bug_1098.in
@@ -0,0 +1,60 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /AcroForm 2 0 R
+  /Pages 3 0 R
+>>
+{{object 2 0}} <<
+  /Fields [6 0 R]
+  /NeedAppearances true
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Pages
+  /Count 1
+  /Kids [4 0 R]
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Page
+  /Parent 3 0 R
+  /Annots [5 0 R 6 0 R]
+  /MediaBox [0 0 220 270]
+>>
+endobj
+
+% Text annotation with a pop-up containing the test string.
+{{object 5 0}} <<
+  /Type /Annot
+  /Subtype /Text
+  /Contents 7 0 R
+
+  % GenerateTextAP() always uses a 20x20 rectangle for the note icon.
+  % CreatePopupAnnot() always uses a 200x200 rectangle for the pop-up.
+  /Rect [10 240 30 260]
+>>
+endobj
+
+% Text field widget annotation with a black border containing the test string.
+{{object 6 0}} <<
+  /Type /Annot
+  /Subtype /Widget
+  /FT /Tx
+  /MK <<
+    /BC [0]
+  >>
+  /Rect [10 10 210 30]
+  /T (FieldName)
+  /V 7 0 R
+>>
+endobj
+
+% Test string "AaÄäКк€🎨!" in UTF-16BE.
+{{object 7 0}}
+<feff 0041 0061 00c4 00e4 041a 043a 20ac d83cdfa8 0021>
+endobj
+
+{{xref}}
+{{trailer}}
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/bug_1098_expected.pdf.0.png b/testing/resources/pixel/bug_1098_expected.pdf.0.png
new file mode 100644
index 0000000..0c518b2
--- /dev/null
+++ b/testing/resources/pixel/bug_1098_expected.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/bug_1098_expected_mac.pdf.0.png b/testing/resources/pixel/bug_1098_expected_mac.pdf.0.png
new file mode 100644
index 0000000..39532a1
--- /dev/null
+++ b/testing/resources/pixel/bug_1098_expected_mac.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/bug_1098_expected_skia.pdf.0.png b/testing/resources/pixel/bug_1098_expected_skia.pdf.0.png
new file mode 100644
index 0000000..8884a3f
--- /dev/null
+++ b/testing/resources/pixel/bug_1098_expected_skia.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/bug_1098_expected_skia_mac.pdf.0.png b/testing/resources/pixel/bug_1098_expected_skia_mac.pdf.0.png
new file mode 100644
index 0000000..e02cdf9
--- /dev/null
+++ b/testing/resources/pixel/bug_1098_expected_skia_mac.pdf.0.png
Binary files differ