OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GFX_FONT_RENDER_PARAMS_H_ | 5 #ifndef UI_GFX_FONT_RENDER_PARAMS_H_ |
6 #define UI_GFX_FONT_RENDER_PARAMS_H_ | 6 #define UI_GFX_FONT_RENDER_PARAMS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "third_party/skia/include/core/SkFontHost.h" | 12 #include "third_party/skia/include/core/SkFontHost.h" |
| 13 #include "ui/gfx/font.h" |
13 #include "ui/gfx/gfx_export.h" | 14 #include "ui/gfx/gfx_export.h" |
14 | 15 |
15 namespace gfx { | 16 namespace gfx { |
16 | 17 |
17 // A collection of parameters describing how text should be rendered on Linux. | 18 // A collection of parameters describing how text should be rendered on Linux. |
18 struct GFX_EXPORT FontRenderParams { | 19 struct GFX_EXPORT FontRenderParams { |
19 FontRenderParams(); | 20 FontRenderParams(); |
20 FontRenderParams(const FontRenderParams& other); | 21 FontRenderParams(const FontRenderParams& other); |
21 ~FontRenderParams(); | 22 ~FontRenderParams(); |
22 | 23 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Requested font families, or empty if unset. | 85 // Requested font families, or empty if unset. |
85 std::vector<std::string> families; | 86 std::vector<std::string> families; |
86 | 87 |
87 // Font size in pixels or points, or 0 if unset. | 88 // Font size in pixels or points, or 0 if unset. |
88 int pixel_size; | 89 int pixel_size; |
89 int point_size; | 90 int point_size; |
90 | 91 |
91 // gfx::Font::FontStyle bit field, or -1 if unset. | 92 // gfx::Font::FontStyle bit field, or -1 if unset. |
92 int style; | 93 int style; |
93 | 94 |
| 95 // Weight of the font. Weight::NORMAL by default. |
| 96 gfx::Font::Weight weight; |
| 97 |
94 // The device scale factor of the display, or 0 if unset. | 98 // The device scale factor of the display, or 0 if unset. |
95 float device_scale_factor; | 99 float device_scale_factor; |
96 }; | 100 }; |
97 | 101 |
98 // Returns the appropriate parameters for rendering the font described by | 102 // Returns the appropriate parameters for rendering the font described by |
99 // |query|. If |family_out| is non-NULL, it will be updated to contain the | 103 // |query|. If |family_out| is non-NULL, it will be updated to contain the |
100 // recommended font family from |query.families|. | 104 // recommended font family from |query.families|. |
101 GFX_EXPORT FontRenderParams GetFontRenderParams( | 105 GFX_EXPORT FontRenderParams GetFontRenderParams( |
102 const FontRenderParamsQuery& query, | 106 const FontRenderParamsQuery& query, |
103 std::string* family_out); | 107 std::string* family_out); |
(...skipping 10 matching lines...) Expand all Loading... |
114 | 118 |
115 // Sets the device scale factor for FontRenderParams to decide | 119 // Sets the device scale factor for FontRenderParams to decide |
116 // if it should enable subpixel positioning. | 120 // if it should enable subpixel positioning. |
117 GFX_EXPORT void SetFontRenderParamsDeviceScaleFactor( | 121 GFX_EXPORT void SetFontRenderParamsDeviceScaleFactor( |
118 float device_scale_factor); | 122 float device_scale_factor); |
119 #endif | 123 #endif |
120 | 124 |
121 } // namespace gfx | 125 } // namespace gfx |
122 | 126 |
123 #endif // UI_GFX_FONT_RENDER_PARAMS_H_ | 127 #endif // UI_GFX_FONT_RENDER_PARAMS_H_ |
OLD | NEW |