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

Unified Diff: ui/gfx/font_fallback_win.cc

Issue 331713003: RenderTextHarfBuzz: Implement font fallback for Win and Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests; add placeholder impl for Mac Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/font_fallback_win.cc
diff --git a/ui/gfx/font_fallback_win.cc b/ui/gfx/font_fallback_win.cc
index 4426718959b3be04a65160f23b808036d94dc64d..901feb01fb633f8483ac57604359b6979e3add9a 100644
--- a/ui/gfx/font_fallback_win.cc
+++ b/ui/gfx/font_fallback_win.cc
@@ -12,6 +12,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/win/registry.h"
#include "ui/gfx/font.h"
+#include "ui/gfx/font_fallback.h"
namespace gfx {
@@ -186,8 +187,6 @@ void ParseFontFamilyString(const std::string& family,
}
}
-} // namespace internal
-
LinkedFontsIterator::LinkedFontsIterator(Font font)
: original_font_(font),
next_font_set_(false),
@@ -243,4 +242,15 @@ const std::vector<Font>* LinkedFontsIterator::GetLinkedFonts() const {
return fonts;
}
+} // namespace internal
+
+std::vector<std::string> GetFallbackFontFamilies(std::string font_family) {
+ internal::LinkedFontsIterator linked_fonts(Font(font_family, 10));
+ std::vector<std::string> fallback_fonts;
+ Font current;
+ while (linked_fonts.NextFont(&current))
+ fallback_fonts.push_back(current.GetFontName());
+ return fallback_fonts;
+}
+
} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698