Index: ui/gfx/platform_font_gtk.cc |
diff --git a/ui/gfx/platform_font_gtk.cc b/ui/gfx/platform_font_gtk.cc |
index 5ccc7c53b3b80ee3048432d138595847ffee0afe..c7555169969846a95569b91070faae4ebfd66c82 100644 |
--- a/ui/gfx/platform_font_gtk.cc |
+++ b/ui/gfx/platform_font_gtk.cc |
@@ -6,14 +6,17 @@ |
#include <algorithm> |
#include <fontconfig/fontconfig.h> |
+#if !defined(USE_WAYLAND) |
#include <gdk/gdk.h> |
#include <gtk/gtk.h> |
+#endif |
#include <map> |
#include <pango/pango.h> |
#include "base/logging.h" |
#include "base/string_piece.h" |
#include "base/utf_string_conversions.h" |
+#include "pango/pangocairo.h" |
#include "third_party/skia/include/core/SkTypeface.h" |
#include "third_party/skia/include/core/SkPaint.h" |
#include "ui/gfx/canvas_skia.h" |
@@ -56,7 +59,8 @@ PangoFontMetrics* GetPangoFontMetrics(PangoFontDescription* desc) { |
static PangoContext* context = NULL; |
if (!context) { |
- context = gdk_pango_context_get_for_screen(gdk_screen_get_default()); |
+ PangoFontMap *font_map = pango_cairo_font_map_get_default(); |
+ context = pango_font_map_create_context(font_map); |
pango_context_set_language(context, pango_language_get_default()); |
} |
@@ -120,6 +124,9 @@ Font* PlatformFontGtk::default_font_ = NULL; |
PlatformFontGtk::PlatformFontGtk() { |
if (default_font_ == NULL) { |
+#if defined(USE_WAYLAND) |
+ char font_name[] = "sans 10"; |
+#else |
GtkSettings* settings = gtk_settings_get_default(); |
gchar* font_name = NULL; |
@@ -128,12 +135,16 @@ PlatformFontGtk::PlatformFontGtk() { |
// Temporary CHECK for helping track down |
// http://code.google.com/p/chromium/issues/detail?id=12530 |
CHECK(font_name) << " Unable to get gtk-font-name for default font."; |
+#endif |
PangoFontDescription* desc = |
pango_font_description_from_string(font_name); |
default_font_ = new Font(desc); |
pango_font_description_free(desc); |
+ |
+#if !defined(USE_WAYLAND) |
g_free(font_name); |
+#endif |
DCHECK(default_font_); |
} |