| 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_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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // the locale has changed. | 34 // the locale has changed. |
| 35 static void ReloadDefaultFont(); | 35 static void ReloadDefaultFont(); |
| 36 | 36 |
| 37 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
| 38 // Sets the default font. |font_description| is a Pango font description that | 38 // Sets the default font. |font_description| is a Pango font description that |
| 39 // will be passed to pango_font_description_from_string(). | 39 // will be passed to pango_font_description_from_string(). |
| 40 static void SetDefaultFontDescription(const std::string& font_description); | 40 static void SetDefaultFontDescription(const std::string& font_description); |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 // Overridden from PlatformFont: | 43 // Overridden from PlatformFont: |
| 44 virtual Font DeriveFont(int size_delta, int style) const OVERRIDE; | 44 virtual Font DeriveFont(int size_delta, int style) const override; |
| 45 virtual int GetHeight() const OVERRIDE; | 45 virtual int GetHeight() const override; |
| 46 virtual int GetBaseline() const OVERRIDE; | 46 virtual int GetBaseline() const override; |
| 47 virtual int GetCapHeight() const OVERRIDE; | 47 virtual int GetCapHeight() const override; |
| 48 virtual int GetExpectedTextWidth(int length) const OVERRIDE; | 48 virtual int GetExpectedTextWidth(int length) const override; |
| 49 virtual int GetStyle() const OVERRIDE; | 49 virtual int GetStyle() const override; |
| 50 virtual std::string GetFontName() const OVERRIDE; | 50 virtual std::string GetFontName() const override; |
| 51 virtual std::string GetActualFontNameForTesting() const OVERRIDE; | 51 virtual std::string GetActualFontNameForTesting() const override; |
| 52 virtual int GetFontSize() const OVERRIDE; | 52 virtual int GetFontSize() const override; |
| 53 virtual const FontRenderParams& GetFontRenderParams() const OVERRIDE; | 53 virtual const FontRenderParams& GetFontRenderParams() const override; |
| 54 virtual NativeFont GetNativeFont() const OVERRIDE; | 54 virtual NativeFont GetNativeFont() const override; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 // Create a new instance of this object with the specified properties. Called | 57 // Create a new instance of this object with the specified properties. Called |
| 58 // from DeriveFont. | 58 // from DeriveFont. |
| 59 PlatformFontPango(const skia::RefPtr<SkTypeface>& typeface, | 59 PlatformFontPango(const skia::RefPtr<SkTypeface>& typeface, |
| 60 const std::string& name, | 60 const std::string& name, |
| 61 int size_pixels, | 61 int size_pixels, |
| 62 int style, | 62 int style, |
| 63 const FontRenderParams& params); | 63 const FontRenderParams& params); |
| 64 virtual ~PlatformFontPango(); | 64 virtual ~PlatformFontPango(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // A Pango font description. | 115 // A Pango font description. |
| 116 static std::string* default_font_description_; | 116 static std::string* default_font_description_; |
| 117 #endif | 117 #endif |
| 118 | 118 |
| 119 DISALLOW_COPY_AND_ASSIGN(PlatformFontPango); | 119 DISALLOW_COPY_AND_ASSIGN(PlatformFontPango); |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 } // namespace gfx | 122 } // namespace gfx |
| 123 | 123 |
| 124 #endif // UI_GFX_PLATFORM_FONT_PANGO_H_ | 124 #endif // UI_GFX_PLATFORM_FONT_PANGO_H_ |
| OLD | NEW |