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 #ifndef UI_GFX_FONT_RENDER_PARAMS_LINUX_H_
6 #define UI_GFX_FONT_RENDER_PARAMS_LINUX_H_
8 #include "ui/base/ui_export.h"
12 // A collection of parameters describing how text should be rendered on Linux.
13 struct UI_EXPORT FontRenderParams
{
14 // No constructor to avoid static initialization.
16 // Level of hinting to be applied.
24 // Different subpixel orders to be used for subpixel rendering.
25 enum SubpixelRendering
{
26 SUBPIXEL_RENDERING_NONE
= 0,
27 SUBPIXEL_RENDERING_RGB
,
28 SUBPIXEL_RENDERING_BGR
,
29 SUBPIXEL_RENDERING_VRGB
,
30 SUBPIXEL_RENDERING_VBGR
,
33 // Antialiasing (grayscale if |subpixel_rendering| is SUBPIXEL_RENDERING_NONE
34 // and RGBA otherwise).
37 // Should subpixel positioning (i.e. fractional X positions for glyphs) be
39 bool subpixel_positioning
;
41 // Should FreeType's autohinter be used (as opposed to Freetype's bytecode
42 // interpreter, which uses fonts' own hinting instructions)?
45 // Should embedded bitmaps in fonts should be used?
51 // Whether subpixel rendering should be used or not, and if so, the display's
53 SubpixelRendering subpixel_rendering
;
56 // Returns the system's default parameters for font rendering.
57 UI_EXPORT
const FontRenderParams
& GetDefaultFontRenderParams();
59 // Returns the system's default parameters for WebKit font rendering.
60 UI_EXPORT
const FontRenderParams
& GetDefaultWebKitFontRenderParams();
62 // Returns the system's default parameters for WebKit subpixel positioning.
63 // Subpixel positioning is special since neither GTK nor FontConfig currently
64 // track it as a preference.
65 // See https://bugs.freedesktop.org/show_bug.cgi?id=50736
66 UI_EXPORT
bool GetDefaultWebkitSubpixelPositioning();
70 #endif // UI_GFX_FONT_RENDER_PARAMS_LINUX_H_