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

Unified Diff: src/ports/SkFontHost_linux.cpp

Issue 195733007: Changes to SkFontHost_linux (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: AnotherPatchSet Created 6 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_linux.cpp
diff --git a/src/ports/SkFontHost_linux.cpp b/src/ports/SkFontHost_linux.cpp
index 2f962d7d40d35e1cc6854eb2c065859e69a9eaff..4d4e6f171e3a3dfbd41f6f765bb76f96ee197940 100644
--- a/src/ports/SkFontHost_linux.cpp
+++ b/src/ports/SkFontHost_linux.cpp
@@ -24,9 +24,6 @@
#ifndef SK_FONT_FILE_PREFIX
# define SK_FONT_FILE_PREFIX "/usr/share/fonts/truetype/"
#endif
-#ifndef SK_FONT_FILE_DIR_SEPERATOR
-# define SK_FONT_FILE_DIR_SEPERATOR "/"
-#endif
bool find_name_and_attributes(SkStream* stream, SkString* name,
SkTypeface::Style* style, bool* isFixedPitch);
@@ -326,8 +323,8 @@ private:
SkString name;
while (iter.next(&name, false)) {
- SkString filename(directory);
- filename.append(name);
+ SkString filename(
+ SkOSPath::SkPathJoin(directory.c_str(), name.c_str()));
bool isFixedPitch;
SkString realname;
@@ -358,9 +355,8 @@ private:
if (name.startsWith(".")) {
continue;
}
- SkString dirname(directory);
- dirname.append(name);
- dirname.append(SK_FONT_FILE_DIR_SEPERATOR);
+ SkString dirname(
+ SkOSPath::SkPathJoin(directory.c_str(), name.c_str()));
load_directory_fonts(dirname);
}
}
@@ -377,7 +373,7 @@ private:
// Try to pick a default font.
static const char* gDefaultNames[] = {
- "Arial", "Verdana", "Times New Roman", NULL
+ "Arial", "Verdana", "Times New Roman", "Droid Sans", NULL
};
for (size_t i = 0; i < SK_ARRAY_COUNT(gDefaultNames); ++i) {
SkFontStyleSet_Custom* set = this->onMatchFamily(gDefaultNames[i]);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698