[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / ui / gfx / font_render_params.h
bloba6e736bfaacaf0062a368c6dd1e4005712597fa3
1 // Copyright 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.
5 #ifndef UI_GFX_FONT_RENDER_PARAMS_H_
6 #define UI_GFX_FONT_RENDER_PARAMS_H_
8 #include <string>
9 #include <vector>
11 #include "ui/gfx/gfx_export.h"
13 namespace gfx {
15 // A collection of parameters describing how text should be rendered on Linux.
16 struct GFX_EXPORT FontRenderParams {
17 FontRenderParams();
18 ~FontRenderParams();
20 // Level of hinting to be applied.
21 enum Hinting {
22 HINTING_NONE = 0,
23 HINTING_SLIGHT,
24 HINTING_MEDIUM,
25 HINTING_FULL,
28 // Different subpixel orders to be used for subpixel rendering.
29 enum SubpixelRendering {
30 SUBPIXEL_RENDERING_NONE = 0,
31 SUBPIXEL_RENDERING_RGB,
32 SUBPIXEL_RENDERING_BGR,
33 SUBPIXEL_RENDERING_VRGB,
34 SUBPIXEL_RENDERING_VBGR,
37 // Antialiasing (grayscale if |subpixel_rendering| is SUBPIXEL_RENDERING_NONE
38 // and RGBA otherwise).
39 bool antialiasing;
41 // Should subpixel positioning (i.e. fractional X positions for glyphs) be
42 // used?
43 bool subpixel_positioning;
45 // Should FreeType's autohinter be used (as opposed to Freetype's bytecode
46 // interpreter, which uses fonts' own hinting instructions)?
47 bool autohinter;
49 // Should embedded bitmaps in fonts should be used?
50 bool use_bitmaps;
52 // Hinting level.
53 Hinting hinting;
55 // Whether subpixel rendering should be used or not, and if so, the display's
56 // subpixel order.
57 SubpixelRendering subpixel_rendering;
60 // Returns the system's default parameters for font rendering.
61 GFX_EXPORT const FontRenderParams& GetDefaultFontRenderParams();
63 // Returns the system's default parameters for WebKit font rendering.
64 // TODO(derat): Rename to GetDefaultFontRenderParamsForWebContents().
65 GFX_EXPORT const FontRenderParams& GetDefaultWebKitFontRenderParams();
67 // Returns the appropriate parameters for rendering the font described by the
68 // passed-in-arguments, any of which may be NULL. If |family_out| is non-NULL,
69 // it will be updated to contain the recommended font family from |family_list|.
70 // TODO(derat): Also accept the font style, so that its bold and italic states
71 // can be passed to Fontconfig in the Linux implementation.
72 GFX_EXPORT FontRenderParams GetCustomFontRenderParams(
73 bool for_web_contents,
74 const std::vector<std::string>* family_list,
75 const int* pixel_size,
76 const int* point_size,
77 std::string* family_out);
79 } // namespace gfx
81 #endif // UI_GFX_FONT_RENDER_PARAMS_H_