Make GetCustomFontRenderParams() pass font style.
[chromium-blink-merge.git] / ui / gfx / font_render_params_android.cc
blobb67ea1840dfd6a95c7ccaf60f9ceb010a55756c1
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
3 // found in the LICENSE file.
5 #include "ui/gfx/font_render_params.h"
7 #include "base/logging.h"
9 namespace gfx {
11 namespace {
13 // Returns the system's default settings.
14 FontRenderParams LoadDefaults() {
15 FontRenderParams params;
16 params.antialiasing = true;
17 params.autohinter = true;
18 params.use_bitmaps = true;
19 params.subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_NONE;
21 // Use subpixel text positioning to keep consistent character spacing when
22 // the page is scaled by a fractional factor.
23 params.subpixel_positioning = true;
24 // Slight hinting renders much better than normal hinting on Android.
25 params.hinting = FontRenderParams::HINTING_SLIGHT;
27 return params;
30 } // namespace
32 const FontRenderParams& GetDefaultFontRenderParams() {
33 static FontRenderParams default_params = LoadDefaults();
34 return default_params;
37 const FontRenderParams& GetDefaultWebKitFontRenderParams() {
38 return GetDefaultFontRenderParams();
41 FontRenderParams GetCustomFontRenderParams(
42 bool for_web_contents,
43 const std::vector<std::string>* family_list,
44 const int* pixel_size,
45 const int* point_size,
46 const int* style,
47 std::string* family_out) {
48 NOTIMPLEMENTED();
49 return GetDefaultFontRenderParams();
52 } // namespace gfx