blob: 301d2897156d8517ffcf9b2c4b5e5f54932398d2 [file] [log] [blame]
ananta99823932015-01-07 02:50:111// Copyright (c) 2014 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.
4
5#include "content/public/common/renderer_preferences.h"
6#include "content/renderer/render_view_impl.h"
7#include "third_party/WebKit/public/web/win/WebFontRendering.h"
scottmga04a4b32015-03-26 22:56:498#include "ui/gfx/font_render_params.h"
ananta99823932015-01-07 02:50:119
10using blink::WebFontRendering;
11
12namespace content {
13
14void RenderViewImpl::UpdateFontRenderingFromRendererPrefs() {
ananta3ac61e882015-01-08 14:27:3315 const RendererPreferences& prefs = renderer_preferences_;
16
17 // Cache the system font metrics in blink.
18 blink::WebFontRendering::setMenuFontMetrics(
19 prefs.menu_font_family_name.c_str(), prefs.menu_font_height);
20
21 blink::WebFontRendering::setSmallCaptionFontMetrics(
22 prefs.small_caption_font_family_name.c_str(),
23 prefs.small_caption_font_height);
24
25 blink::WebFontRendering::setStatusFontMetrics(
26 prefs.status_font_family_name.c_str(), prefs.status_font_height);
scottmga04a4b32015-03-26 22:56:4927
28 blink::WebFontRendering::setLCDOrder(
29 gfx::FontRenderParams::SubpixelRenderingToSkiaLCDOrder(
30 prefs.subpixel_rendering));
31 blink::WebFontRendering::setLCDOrientation(
32 gfx::FontRenderParams::SubpixelRenderingToSkiaLCDOrientation(
33 prefs.subpixel_rendering));
ananta99823932015-01-07 02:50:1134}
35
36} // namespace content