Avoid setting FXTEXT_CLEARTYPE when FXTEXT_NOSMOOTH is in use.

Avoid setting option FXTEXT_CLEARTYPE (use LCD optimization) if flag
FXTEXT_NOSMOOTH (disabling anti aliasing on text) is in use, since
LCD optimization can only be used when anti aliasing is enabled.

Change-Id: Ie7ee042fe34ea9a84357b9f74d10d63b3b317cd3
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/70150
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Hui Yingst <nigi@chromium.org>
diff --git a/core/fpdfapi/render/cpdf_textrenderer.cpp b/core/fpdfapi/render/cpdf_textrenderer.cpp
index 3f5be2b..2bdce2f 100644
--- a/core/fpdfapi/render/cpdf_textrenderer.cpp
+++ b/core/fpdfapi/render/cpdf_textrenderer.cpp
@@ -30,13 +30,13 @@
   if (pFont->IsCIDFont())
     text_options |= FXFONT_CIDFONT;
 
-  if (options.GetOptions().bClearType) {
+  if (options.GetOptions().bNoTextSmooth) {
+    text_options |= FXTEXT_NOSMOOTH;
+  } else if (options.GetOptions().bClearType) {
     text_options |= FXTEXT_CLEARTYPE;
     if (options.GetOptions().bBGRStripe)
       text_options |= FXTEXT_BGR_STRIPE;
   }
-  if (options.GetOptions().bNoTextSmooth)
-    text_options |= FXTEXT_NOSMOOTH;
   if (options.GetOptions().bNoNativeText)
     text_options |= FXTEXT_NO_NATIVETEXT;