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

Unified Diff: ui/gfx/font_render_params_linux.cc

Issue 417003002: linux: Force full hinting when antialiasing is disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a comment Created 6 years, 5 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 | « no previous file | ui/gfx/font_render_params_linux_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/font_render_params_linux.cc
diff --git a/ui/gfx/font_render_params_linux.cc b/ui/gfx/font_render_params_linux.cc
index e8e60e3e68ac7061e9ee5b4e4fc20c2eff196dab..f7c1119c703ae80503450342931223673142ce67 100644
--- a/ui/gfx/font_render_params_linux.cc
+++ b/ui/gfx/font_render_params_linux.cc
@@ -128,15 +128,25 @@ FontRenderParams GetFontRenderParams(const FontRenderParamsQuery& query,
params = delegate->GetDefaultFontRenderParams();
QueryFontconfig(query, &params, family_out);
- // Fontconfig doesn't support configuring subpixel positioning; check a flag.
- params.subpixel_positioning = CommandLine::ForCurrentProcess()->HasSwitch(
- query.for_web_contents ?
- switches::kEnableWebkitTextSubpixelPositioning :
- switches::kEnableBrowserTextSubpixelPositioning);
-
- // To enable subpixel positioning, we need to disable hinting.
- if (params.subpixel_positioning)
- params.hinting = FontRenderParams::HINTING_NONE;
+ if (!params.antialiasing) {
+ // Cairo forces full hinting when antialiasing is disabled, since anything
+ // less than that looks awful; do the same here. Requesting subpixel
+ // rendering or positioning doesn't make sense either.
+ params.hinting = FontRenderParams::HINTING_FULL;
+ params.subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_NONE;
+ params.subpixel_positioning = false;
+ } else {
+ // Fontconfig doesn't support configuring subpixel positioning; check a
+ // flag.
+ params.subpixel_positioning = CommandLine::ForCurrentProcess()->HasSwitch(
+ query.for_web_contents ?
+ switches::kEnableWebkitTextSubpixelPositioning :
+ switches::kEnableBrowserTextSubpixelPositioning);
+
+ // To enable subpixel positioning, we need to disable hinting.
+ if (params.subpixel_positioning)
+ params.hinting = FontRenderParams::HINTING_NONE;
+ }
// Use the first family from the list if Fontconfig didn't suggest a family.
if (family_out && family_out->empty() && !query.families.empty())
« no previous file with comments | « no previous file | ui/gfx/font_render_params_linux_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698