diff options
author | kochi <kochi@chromium.org> | 2015-08-31 00:32:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-31 07:33:02 +0000 |
commit | b48e1b8c1aaf9b9ea0f397b57e979ba4384a09e2 (patch) | |
tree | f543315386f52877659c1f2055dcc3a344857b21 /content | |
parent | 4f7b881fc469476dfd9dbfe26d007d16045942d8 (diff) | |
download | chromium_src-b48e1b8c1aaf9b9ea0f397b57e979ba4384a09e2.zip chromium_src-b48e1b8c1aaf9b9ea0f397b57e979ba4384a09e2.tar.gz chromium_src-b48e1b8c1aaf9b9ea0f397b57e979ba4384a09e2.tar.bz2 |
Allow default font size changing on Linux.
Currently base rendering font size on Linux is hardcoded to 16.0 with no possibility of changing it. This patch add such possibility in RendererPreferences.
Webkit part: https://codereview.chromium.org/570243002/
This was once landed and reverted:
https://codereview.chromium.org/549303004 (original)
https://codereview.chromium.org/1319613004 (revert)
due to unexpected default font size change.
Now this CL removes the problematic part to derive the default font
size from desktop environment.
BUG=525176
TBR=joleksy@opera.com, jochen@chromium.org, erg@chromium.org, jln@chromium.org
Review URL: https://codereview.chromium.org/1303163008
Cr-Commit-Position: refs/heads/master@{#346353}
Diffstat (limited to 'content')
-rw-r--r-- | content/common/view_messages.h | 1 | ||||
-rw-r--r-- | content/public/common/renderer_preferences.cc | 1 | ||||
-rw-r--r-- | content/public/common/renderer_preferences.h | 2 | ||||
-rw-r--r-- | content/renderer/render_view_linux.cc | 6 |
4 files changed, 10 insertions, 0 deletions
diff --git a/content/common/view_messages.h b/content/common/view_messages.h index 415c314..cd34d14 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h @@ -289,6 +289,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::RendererPreferences) IPC_STRUCT_TRAITS_MEMBER(arrow_bitmap_height_vertical_scroll_bar_in_dips) IPC_STRUCT_TRAITS_MEMBER(arrow_bitmap_width_horizontal_scroll_bar_in_dips) #endif + IPC_STRUCT_TRAITS_MEMBER(default_font_size) IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_BEGIN(content::WebPluginGeometry) diff --git a/content/public/common/renderer_preferences.cc b/content/public/common/renderer_preferences.cc index 48a784d..57c259f 100644 --- a/content/public/common/renderer_preferences.cc +++ b/content/public/common/renderer_preferences.cc @@ -51,6 +51,7 @@ RendererPreferences::RendererPreferences() arrow_bitmap_height_vertical_scroll_bar_in_dips(0), arrow_bitmap_width_horizontal_scroll_bar_in_dips(0) #endif + , default_font_size(0) {} RendererPreferences::~RendererPreferences() { } diff --git a/content/public/common/renderer_preferences.h b/content/public/common/renderer_preferences.h index 1a69081..aaee9d5 100644 --- a/content/public/common/renderer_preferences.h +++ b/content/public/common/renderer_preferences.h @@ -175,6 +175,8 @@ struct CONTENT_EXPORT RendererPreferences { int32 arrow_bitmap_width_horizontal_scroll_bar_in_dips; #endif + // The default font size used for rendering on Linux. + int default_font_size; }; } // namespace content diff --git a/content/renderer/render_view_linux.cc b/content/renderer/render_view_linux.cc index 7f3ab8d..c3b6116 100644 --- a/content/renderer/render_view_linux.cc +++ b/content/renderer/render_view_linux.cc @@ -14,6 +14,8 @@ namespace content { namespace { +const int kMaxDefaultFontSize = 999; + SkPaint::Hinting RendererPreferencesToSkiaHinting( const RendererPreferences& prefs) { if (!prefs.should_antialias_text) { @@ -62,6 +64,10 @@ void RenderViewImpl::UpdateFontRenderingFromRendererPrefs() { prefs.subpixel_rendering != gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE); WebFontRendering::setSubpixelPositioning(prefs.use_subpixel_positioning); + if (prefs.default_font_size > 0 && + prefs.default_font_size <= kMaxDefaultFontSize) { + WebFontRendering::setDefaultFontSize(prefs.default_font_size); + } } } // namespace content |