OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_PANGO_UTIL_H_ | 5 #ifndef UI_GFX_PANGO_UTIL_H_ |
6 #define UI_GFX_PANGO_UTIL_H_ | 6 #define UI_GFX_PANGO_UTIL_H_ |
7 | 7 |
8 #include <cairo/cairo.h> | 8 #include <cairo/cairo.h> |
9 #include <pango/pango.h> | 9 #include <pango/pango.h> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 PangoFontDescription* description_; | 41 PangoFontDescription* description_; |
42 | 42 |
43 DISALLOW_COPY_AND_ASSIGN(ScopedPangoFontDescription); | 43 DISALLOW_COPY_AND_ASSIGN(ScopedPangoFontDescription); |
44 }; | 44 }; |
45 | 45 |
46 // ---------------------------------------------------------------------------- | 46 // ---------------------------------------------------------------------------- |
47 // All other methods in this file are only to be used within the ui/ directory. | 47 // All other methods in this file are only to be used within the ui/ directory. |
48 // They are shared with internal skia interfaces. | 48 // They are shared with internal skia interfaces. |
49 // ---------------------------------------------------------------------------- | 49 // ---------------------------------------------------------------------------- |
50 | 50 |
51 // Configures |layout| for the passed-in parameters. | |
52 void SetUpPangoLayout( | |
53 PangoLayout* layout, | |
54 const base::string16& text, | |
55 const FontList& font_list, | |
56 base::i18n::TextDirection text_direction, | |
57 int flags); | |
58 | |
59 // Returns the size in pixels for the specified |pango_font|. | 51 // Returns the size in pixels for the specified |pango_font|. |
60 int GetPangoFontSizeInPixels(PangoFontDescription* pango_font); | 52 int GetPangoFontSizeInPixels(PangoFontDescription* pango_font); |
61 | 53 |
62 // Retrieves the Pango metrics for a Pango font description. Caches the metrics | 54 // Retrieves the Pango metrics for a Pango font description. Caches the metrics |
63 // and never frees them. The metrics objects are relatively small and very | 55 // and never frees them. The metrics objects are relatively small and very |
64 // expensive to look up. | 56 // expensive to look up. |
65 PangoFontMetrics* GetPangoFontMetrics(PangoFontDescription* desc); | 57 PangoFontMetrics* GetPangoFontMetrics(PangoFontDescription* desc); |
66 | 58 |
67 } // namespace gfx | 59 } // namespace gfx |
68 | 60 |
69 #endif // UI_GFX_PANGO_UTIL_H_ | 61 #endif // UI_GFX_PANGO_UTIL_H_ |
OLD | NEW |