Make PDF_ENABLE_SKIA_TYPEFACE_CHECKS a GN build argument.

Currently, no builds should set this, but allow development to
continue making these checks.

Change-Id: Iba0b507393ca5a0a2ec6f90aedd82adfb8ecb182
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/148192
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index e025aad..c28cc01 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -43,6 +43,10 @@
     defines += [ "PDF_ENABLE_FONTATIONS" ]
   }
 
+  if (pdf_use_skia && pdf_enable_skia_typeface_checks) {
+    defines += [ "PDF_ENABLE_SKIA_TYPEFACE_CHECKS" ]
+  }
+
   if (pdf_use_skia && pdf_enable_rust_png) {
     defines += [ "PDF_ENABLE_RUST_PNG" ]
   }
diff --git a/core/fxge/cfx_face.cpp b/core/fxge/cfx_face.cpp
index 0a353e0..04e4286 100644
--- a/core/fxge/cfx_face.cpp
+++ b/core/fxge/cfx_face.cpp
@@ -32,10 +32,6 @@
 
 #if defined(PDF_USE_SKIA)
 #include "third_party/skia/include/core/SkTypeface.h"  // nogncheck
-
-// Define the following to enable additional runtime checks during
-// the development process.
-// #define PDF_ENABLE_SKIA_TYPEFACE_CHECKS 1
 #endif
 
 #if defined(PDF_ENABLE_SKIA_TYPEFACE_CHECKS)
diff --git a/pdfium.gni b/pdfium.gni
index 63d25f6..3b3f1d9 100644
--- a/pdfium.gni
+++ b/pdfium.gni
@@ -65,6 +65,11 @@
   # Note that Fontations requires Skia and Rust support.
   pdf_enable_fontations = pdf_enable_fontations_override
 
+  # Build PDFium with code to compare FT/Skia/Fontations results in
+  # parallel. Currently flags several spots, so must be false except when
+  # developing locally.
+  pdf_enable_skia_typeface_checks = false
+
   # Build PDFium with Rust-based PNG decoder and encoder.
   # If enabled, it ensures that PDFium doesn't depend on `libpng`.
   # Note that `pdf_enable_rust_png` requires Skia and Rust support.