| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "gfx/platform_font_gtk.h" | 5 #include "ui/gfx/platform_font_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <fontconfig/fontconfig.h> | 8 #include <fontconfig/fontconfig.h> |
| 9 #include <gdk/gdk.h> | 9 #include <gdk/gdk.h> |
| 10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
| 11 #include <map> | 11 #include <map> |
| 12 #include <pango/pango.h> | 12 #include <pango/pango.h> |
| 13 | 13 |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/string_piece.h" | 15 #include "base/string_piece.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "gfx/canvas_skia.h" | |
| 18 #include "gfx/font.h" | |
| 19 #include "gfx/gtk_util.h" | |
| 20 #include "third_party/skia/include/core/SkTypeface.h" | 17 #include "third_party/skia/include/core/SkTypeface.h" |
| 21 #include "third_party/skia/include/core/SkPaint.h" | 18 #include "third_party/skia/include/core/SkPaint.h" |
| 19 #include "ui/gfx/canvas_skia.h" |
| 20 #include "ui/gfx/font.h" |
| 21 #include "ui/gfx/gtk_util.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // The font family name which is used when a user's application font for | 25 // The font family name which is used when a user's application font for |
| 26 // GNOME/KDE is a non-scalable one. The name should be listed in the | 26 // GNOME/KDE is a non-scalable one. The name should be listed in the |
| 27 // IsFallbackFontAllowed function in skia/ext/SkFontHost_fontconfig_direct.cpp. | 27 // IsFallbackFontAllowed function in skia/ext/SkFontHost_fontconfig_direct.cpp. |
| 28 const char* kFallbackFontFamilyName = "sans"; | 28 const char* kFallbackFontFamilyName = "sans"; |
| 29 | 29 |
| 30 // Returns the number of pixels in a point. | 30 // Returns the number of pixels in a point. |
| 31 // - multiply a point size by this to get pixels ("device units") | 31 // - multiply a point size by this to get pixels ("device units") |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 return new PlatformFontGtk(native_font); | 441 return new PlatformFontGtk(native_font); |
| 442 } | 442 } |
| 443 | 443 |
| 444 // static | 444 // static |
| 445 PlatformFont* PlatformFont::CreateFromNameAndSize(const string16& font_name, | 445 PlatformFont* PlatformFont::CreateFromNameAndSize(const string16& font_name, |
| 446 int font_size) { | 446 int font_size) { |
| 447 return new PlatformFontGtk(font_name, font_size); | 447 return new PlatformFontGtk(font_name, font_size); |
| 448 } | 448 } |
| 449 | 449 |
| 450 } // namespace gfx | 450 } // namespace gfx |
| OLD | NEW |