Chromium Code Reviews| 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..b90ee62856baae5ecd6aab8bc4b8307384b6b52a 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, ¶ms, 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 |
|
msw
2014/07/24 22:25:43
nit: "disabled, since"
Daniel Erat
2014/07/24 22:52:00
arguable but done :-P
|
| + // 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()) |