Use "Chrome Symbol" font on all platforms aside from Windows

Currently in CFX_FontMapper::FindSubstFont(), #if logic lets Apple
platforms and Android use an internal Symbol font when FindSubstFont()
calls for a Symbol font. The reasoning is that these platforms may not
provide a Symbol font. The same reasoning applies to Linux, so change
the #if condition to all platforms aside from Windows.

Add a pixel test to ensure a PDF that does not embed the Symbol font
still renders correctly. The hermetic test environment does not provide
the Symbol font either, so this test fails on Windows. Suppress the
test on Windows, as it does not reflect the real environment.

Bug: chromium:1442723
Change-Id: I1505fb45060fbe2293b6af976489d2878fa7eea0
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/107110
Reviewed-by: Nigi <nigi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp
index ea79ecf..8ad189a 100644
--- a/core/fxge/cfx_fontmapper.cpp
+++ b/core/fxge/cfx_fontmapper.cpp
@@ -716,7 +716,7 @@
   }
 
   if (Charset == FX_Charset::kSymbol) {
-#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID)
+#if !BUILDFLAG(IS_WIN)
     if (subst_name == "Symbol") {
       subst_font->m_Family = "Chrome Symbol";
       subst_font->m_Charset = FX_Charset::kSymbol;
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index 08008e8..623c486 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -345,6 +345,11 @@
 # TODO(chromium:1356149): Remove after associated bug is fixed
 bug_1356149.in mac * * agg
 
+# This test is intentionally suppressed on Windows. Normally, Windows provides
+# the Symbol font, so this PDF would render correctly. However, in the hermetic
+# test environment, there is no Symbol font and the rendering is incorrect.
+bug_1442723.in win * * *
+
 # TODO(pdfium:1457): Remove after associated bug is fixed
 bug_1457.in * * * *
 
diff --git a/testing/resources/pixel/bug_1442723.in b/testing/resources/pixel/bug_1442723.in
new file mode 100644
index 0000000..070c97c
--- /dev/null
+++ b/testing/resources/pixel/bug_1442723.in
@@ -0,0 +1,80 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+endobj
+{{object 2 0}} <<
+  /Type /Pages
+  /Count 1
+  /Kids [3 0 R]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Contents 4 0 R
+  /MediaBox [0 0 200 100]
+  /Resources <<
+    /Font <<
+      /F1 5 0 R
+    >>
+  >>
+>>
+endobj
+{{object 4 0}} <<
+  {{streamlen}}
+>>
+stream
+BT
+75 50 TD
+/F1 12 Tf
+10 Tc (=\331\367\370\366\347) Tj
+ET
+endstream
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /TrueType
+  /BaseFont /Symbol
+  /FirstChar 31
+  /FontDescriptor 6 0 R
+  /LastChar 255
+  /Widths [600 250 333 713 500 549 833 778 439 333 333 500 549 250 549 250 278
+           500 500 500 500 500 500 500 500 500 500 278 278 549 549 549 444 549
+           722 667 722 612 611 763 603 722 333 631 722 686 889 722 722 768 741
+           556 592 611 690 439 768 645 795 611 333 863 333 658 500 500 631 549
+           549 494 439 521 411 603 329 603 549 549 576 521 549 549 521 549 603
+           439 576 713 686 493 686 494 480 200 480 549 600 600 600 600 600 600
+           600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+           600 600 600 600 600 600 600 600 600 600 600 620 247 549 167 713 500
+           753 753 753 753 1042 987 603 987 603 400 549 411 549 549 713 494 460
+           549 549 549 549 1000 603 1000 658 823 686 795 987 768 768 823 768 768
+           713 713 713 713 713 713 713 768 713 790 790 890 823 549 250 713 603
+           603 1042 987 603 987 603 494 329 790 790 786 713 384 384 384 384 384
+           384 494 494 494 494 600 329 274 686 686 686 384 384 384 384 384 384
+           494 494 494 600]
+>>
+endobj
+{{object 6 0}} <<
+  /Type /FontDescriptor
+  /Ascent 1000
+  /AvgWidth 602
+  /CapHeight 1000
+  /Descent -217
+  /Flags 6
+  /FontBBox [-250 -217 1258 1000]
+  /FontName /Symbol
+  /ItalicAngle 0
+  /Leading 217
+  /MaxWidth 1048
+  /MissingWidth 602
+  /StemH 110
+  /StemV 110
+  /XHeight 700
+>>
+endobj
+{{xref}}
+{{trailer}}
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/bug_1442723_expected.pdf.0.png b/testing/resources/pixel/bug_1442723_expected.pdf.0.png
new file mode 100644
index 0000000..eacc914
--- /dev/null
+++ b/testing/resources/pixel/bug_1442723_expected.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/bug_1442723_expected_agg_mac.pdf.0.png b/testing/resources/pixel/bug_1442723_expected_agg_mac.pdf.0.png
new file mode 100644
index 0000000..46281bc
--- /dev/null
+++ b/testing/resources/pixel/bug_1442723_expected_agg_mac.pdf.0.png
Binary files differ