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

Side by Side Diff: ui/gfx/font_render_params_android.cc

Issue 382273002: ui/gfx: Allow for font-specific rendering settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix fontconfig leak 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/font_render_params.h ('k') | ui/gfx/font_render_params_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/font_render_params.h" 5 #include "ui/gfx/font_render_params.h"
6 6
7 #include "base/logging.h"
8
7 namespace gfx { 9 namespace gfx {
8 10
9 namespace { 11 namespace {
10 12
11 // Initializes |params| with the system's default settings. 13 // Initializes |params| with the system's default settings.
12 void LoadDefaults(FontRenderParams* params) { 14 void LoadDefaults(FontRenderParams* params) {
13 params->antialiasing = true; 15 params->antialiasing = true;
14 params->autohinter = true; 16 params->autohinter = true;
15 params->use_bitmaps = true; 17 params->use_bitmaps = true;
16 params->subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_NONE; 18 params->subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_NONE;
17 19
18 // Use subpixel text positioning to keep consistent character spacing when 20 // Use subpixel text positioning to keep consistent character spacing when
19 // the page is scaled by a fractional factor. 21 // the page is scaled by a fractional factor.
20 params->subpixel_positioning = true; 22 params->subpixel_positioning = true;
21 // Slight hinting renders much better than normal hinting on Android. 23 // Slight hinting renders much better than normal hinting on Android.
22 params->hinting = FontRenderParams::HINTING_SLIGHT; 24 params->hinting = FontRenderParams::HINTING_SLIGHT;
23 } 25 }
24 26
25 } // namespace 27 } // namespace
26 28
27 const FontRenderParams& GetDefaultFontRenderParams() { 29 const FontRenderParams& GetDefaultFontRenderParams() {
28 static bool loaded_defaults = false; 30 static bool loaded_defaults = false;
29 static FontRenderParams default_params; 31 static FontRenderParams default_params;
30 if (!loaded_defaults) 32 if (!loaded_defaults)
31 LoadDefaults(&default_params); 33 LoadDefaults(&default_params);
32 loaded_defaults = true; 34 loaded_defaults = true;
33 return default_params; 35 return default_params;
34 } 36 }
35 37
38 FontRenderParams GetCustomFontRenderParams(
39 bool for_web_contents,
40 const std::vector<std::string>* family_list,
41 const int* pixel_size,
42 const int* point_size,
43 std::string* family_out) {
44 NOTIMPLEMENTED();
45 return GetDefaultFontRenderParams();
46 }
47
36 const FontRenderParams& GetDefaultWebKitFontRenderParams() { 48 const FontRenderParams& GetDefaultWebKitFontRenderParams() {
37 return GetDefaultFontRenderParams(); 49 return GetDefaultFontRenderParams();
38 } 50 }
39 51
40 } // namespace gfx 52 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/font_render_params.h ('k') | ui/gfx/font_render_params_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698