GTK based Linux to respect subpixel positioning request.
[chromium-blink-merge.git] / ui / gfx / font_render_params_linux.h
blobec39302dcccb6e9f53219a6abe5548fb95bbaa3b
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"
10 namespace gfx {
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.
17 enum Hinting {
18 HINTING_NONE = 0,
19 HINTING_SLIGHT,
20 HINTING_MEDIUM,
21 HINTING_FULL,
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).
35 bool antialiasing;
37 // Should subpixel positioning (i.e. fractional X positions for glyphs) be
38 // used?
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)?
43 bool autohinter;
45 // Should embedded bitmaps in fonts should be used?
46 bool use_bitmaps;
48 // Hinting level.
49 Hinting hinting;
51 // Whether subpixel rendering should be used or not, and if so, the display's
52 // subpixel order.
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();
68 } // namespace gfx
70 #endif // UI_GFX_FONT_RENDER_PARAMS_LINUX_H_