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

Unified Diff: ui/gfx/platform_font_pango.cc

Issue 79263004: Enables font-related unittests again. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/platform_font_pango.h ('k') | ui/gfx/platform_font_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/platform_font_pango.cc
diff --git a/ui/gfx/platform_font_pango.cc b/ui/gfx/platform_font_pango.cc
index 020cc7f2291f3c030355b5db8ad3ca3f6a7934ec..db1d7dce3514763d885ec51db2eef13c040d7522 100644
--- a/ui/gfx/platform_font_pango.cc
+++ b/ui/gfx/platform_font_pango.cc
@@ -15,6 +15,7 @@
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "third_party/skia/include/core/SkPaint.h"
+#include "third_party/skia/include/core/SkString.h"
#include "third_party/skia/include/core/SkTypeface.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
@@ -215,6 +216,12 @@ std::string PlatformFontPango::GetFontName() const {
return font_family_;
}
+std::string PlatformFontPango::GetActualFontNameForTesting() const {
+ SkString family_name;
+ typeface_->getFamilyName(&family_name);
+ return family_name.c_str();
+}
+
int PlatformFontPango::GetFontSize() const {
return font_size_pixels_;
}
@@ -293,7 +300,7 @@ void PlatformFontPango::InitWithNameAndSize(const std::string& font_name,
std::string fallback;
skia::RefPtr<SkTypeface> typeface = skia::AdoptRef(
- SkTypeface::CreateFromName(font_name.c_str(), SkTypeface::kNormal));
+ SkTypeface::CreateFromName(font_name.c_str(), SkTypeface::kNormal));
if (!typeface) {
// A non-scalable font such as .pcf is specified. Falls back to a default
// scalable font.
« no previous file with comments | « ui/gfx/platform_font_pango.h ('k') | ui/gfx/platform_font_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698