Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Side by Side Diff: ui/gfx/platform_font_gtk.cc

Issue 7739016: aura-views: Make views_aura_desktop compile and run on linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/canvas_skia_linux.cc ('k') | views/aura_desktop/aura_desktop_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "ui/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 <map> 9 #include <map>
10 #include <pango/pango.h> 10 #include <pango/pango.h>
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 FcPatternGetString(match, FC_FAMILY, 0, &match_family); 107 FcPatternGetString(match, FC_FAMILY, 0, &match_family);
108 108
109 string16 font_family = UTF8ToUTF16(reinterpret_cast<char*>(match_family)); 109 string16 font_family = UTF8ToUTF16(reinterpret_cast<char*>(match_family));
110 FcPatternDestroy(match); 110 FcPatternDestroy(match);
111 FcPatternDestroy(pattern); 111 FcPatternDestroy(pattern);
112 free(family_name_copy); 112 free(family_name_copy);
113 return font_family; 113 return font_family;
114 } 114 }
115 115
116 std::string GetDefaultFont() { 116 std::string GetDefaultFont() {
117 #if defined(USE_WAYLAND) 117 #if defined(USE_WAYLAND) || defined(USE_AURA)
118 return "sans 10"; 118 return "sans 10";
119 #else 119 #else
120 GtkSettings* settings = gtk_settings_get_default(); 120 GtkSettings* settings = gtk_settings_get_default();
121 121
122 gchar* font_name = NULL; 122 gchar* font_name = NULL;
123 g_object_get(settings, "gtk-font-name", &font_name, NULL); 123 g_object_get(settings, "gtk-font-name", &font_name, NULL);
124 124
125 // Temporary CHECK for helping track down 125 // Temporary CHECK for helping track down
126 // http://code.google.com/p/chromium/issues/detail?id=12530 126 // http://code.google.com/p/chromium/issues/detail?id=12530
127 CHECK(font_name) << " Unable to get gtk-font-name for default font."; 127 CHECK(font_name) << " Unable to get gtk-font-name for default font.";
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 return new PlatformFontGtk(native_font); 462 return new PlatformFontGtk(native_font);
463 } 463 }
464 464
465 // static 465 // static
466 PlatformFont* PlatformFont::CreateFromNameAndSize(const string16& font_name, 466 PlatformFont* PlatformFont::CreateFromNameAndSize(const string16& font_name,
467 int font_size) { 467 int font_size) {
468 return new PlatformFontGtk(font_name, font_size); 468 return new PlatformFontGtk(font_name, font_size);
469 } 469 }
470 470
471 } // namespace gfx 471 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/canvas_skia_linux.cc ('k') | views/aura_desktop/aura_desktop_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698