Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6453)

Unified Diff: core/fxge/ge/fx_ge_text.cpp

Issue 1982263004: Don't use LCD antialiasing if Fontconfig doesn't support hinting (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Initialize m_FTLibrarySupportsHinting Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxge/ge/fx_ge_fontmap.cpp ('k') | core/fxge/include/fx_font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/ge/fx_ge_text.cpp
diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp
index b0f6a6e63a720381737551189ea0ec18fbeabcc1..46edaf7cbe35c2abe7c90f210b6fe602d82208d3 100644
--- a/core/fxge/ge/fx_ge_text.cpp
+++ b/core/fxge/ge/fx_ge_text.cpp
@@ -257,7 +257,14 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars,
} else {
bClearType = text_flags & FXTEXT_CLEARTYPE;
}
- if ((m_RenderCaps & (FXRC_ALPHA_OUTPUT | FXRC_CMYK_OUTPUT))) {
+ if (!CFX_GEModule::Get()->GetFontMgr()->FTLibrarySupportsHinting()) {
+ // Some Freetype implementations (like the one packaged with Fedora) do
+ // not support hinting due to patents 6219025, 6239783, 6307566,
+ // 6225973, 6243070, 6393145, 6421054, 6282327, and 6624828; the latest
+ // one expires 10/7/19. This makes LCD antialiasing very ugly, so we
+ // instead fall back on NORMAL antialiasing.
+ anti_alias = FXFT_RENDER_MODE_NORMAL;
+ } else if ((m_RenderCaps & (FXRC_ALPHA_OUTPUT | FXRC_CMYK_OUTPUT))) {
anti_alias = FXFT_RENDER_MODE_LCD;
bNormal = TRUE;
} else if (m_bpp < 16) {
« no previous file with comments | « core/fxge/ge/fx_ge_fontmap.cpp ('k') | core/fxge/include/fx_font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698