| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PLATFORM_FONT_PANGO_H_ | 5 #ifndef UI_GFX_PLATFORM_FONT_PANGO_H_ |
| 6 #define UI_GFX_PLATFORM_FONT_PANGO_H_ | 6 #define UI_GFX_PLATFORM_FONT_PANGO_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 10 #include "third_party/skia/include/core/SkRefCnt.h" | 11 #include "third_party/skia/include/core/SkRefCnt.h" |
| 11 #include "ui/gfx/platform_font.h" | 12 #include "ui/gfx/platform_font.h" |
| 12 | 13 |
| 13 class SkTypeface; | 14 class SkTypeface; |
| 14 class SkPaint; | 15 class SkPaint; |
| 15 | 16 |
| 16 namespace gfx { | 17 namespace gfx { |
| 17 | 18 |
| 18 class UI_EXPORT PlatformFontPango : public PlatformFont { | 19 class UI_EXPORT PlatformFontPango : public PlatformFont { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 32 static void ReloadDefaultFont(); | 33 static void ReloadDefaultFont(); |
| 33 | 34 |
| 34 // Position as an offset from the height of the drawn text, used to draw | 35 // Position as an offset from the height of the drawn text, used to draw |
| 35 // an underline. This is a negative number, so the underline would be | 36 // an underline. This is a negative number, so the underline would be |
| 36 // drawn at y + height + underline_position; | 37 // drawn at y + height + underline_position; |
| 37 double underline_position() const; | 38 double underline_position() const; |
| 38 // The thickness to draw the underline. | 39 // The thickness to draw the underline. |
| 39 double underline_thickness() const; | 40 double underline_thickness() const; |
| 40 | 41 |
| 41 // Overridden from PlatformFont: | 42 // Overridden from PlatformFont: |
| 42 virtual Font DeriveFont(int size_delta, int style) const; | 43 virtual Font DeriveFont(int size_delta, int style) const OVERRIDE; |
| 43 virtual int GetHeight() const; | 44 virtual int GetHeight() const OVERRIDE; |
| 44 virtual int GetBaseline() const; | 45 virtual int GetBaseline() const OVERRIDE; |
| 45 virtual int GetAverageCharacterWidth() const; | 46 virtual int GetAverageCharacterWidth() const OVERRIDE; |
| 46 virtual int GetStringWidth(const string16& text) const; | 47 virtual int GetStringWidth(const string16& text) const OVERRIDE; |
| 47 virtual int GetExpectedTextWidth(int length) const; | 48 virtual int GetExpectedTextWidth(int length) const OVERRIDE; |
| 48 virtual int GetStyle() const; | 49 virtual int GetStyle() const OVERRIDE; |
| 49 virtual std::string GetFontName() const; | 50 virtual std::string GetFontName() const OVERRIDE; |
| 50 virtual int GetFontSize() const; | 51 virtual int GetFontSize() const OVERRIDE; |
| 51 virtual NativeFont GetNativeFont() const; | 52 virtual NativeFont GetNativeFont() const OVERRIDE; |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 // Create a new instance of this object with the specified properties. Called | 55 // Create a new instance of this object with the specified properties. Called |
| 55 // from DeriveFont. | 56 // from DeriveFont. |
| 56 PlatformFontPango(SkTypeface* typeface, | 57 PlatformFontPango(SkTypeface* typeface, |
| 57 const std::string& name, | 58 const std::string& name, |
| 58 int size, | 59 int size, |
| 59 int style); | 60 int style); |
| 60 virtual ~PlatformFontPango(); | 61 virtual ~PlatformFontPango(); |
| 61 | 62 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 double underline_position_pixels_; | 103 double underline_position_pixels_; |
| 103 double underline_thickness_pixels_; | 104 double underline_thickness_pixels_; |
| 104 | 105 |
| 105 // The default font, used for the default constructor. | 106 // The default font, used for the default constructor. |
| 106 static Font* default_font_; | 107 static Font* default_font_; |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 } // namespace gfx | 110 } // namespace gfx |
| 110 | 111 |
| 111 #endif // UI_GFX_PLATFORM_FONT_PANGO_H_ | 112 #endif // UI_GFX_PLATFORM_FONT_PANGO_H_ |
| OLD | NEW |