aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontHost_linux.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-13 16:24:49 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-13 16:24:49 +0000
commitea163cc3a708fc634ace369ce6c5b7b9da7fe9cc (patch)
tree8e68ebed415d4cbeaf86cea630c0f39dba8d8167 /src/ports/SkFontHost_linux.cpp
parentcdbbbcc90987c87d7192abf203a99eb14f7f2243 (diff)
Changes to SkFontHost_linux
* Use SkOSPath::SkPathJoin() rather than append so that SK_FONT_FILE_PREFIX does not have to end in a '/'. * Add another font to the default font list. Motivation: Some tests fail when there are no default fonts. BUG=skia:2282 R=bungeman@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/195733007 git-svn-id: http://skia.googlecode.com/svn/trunk@13789 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports/SkFontHost_linux.cpp')
-rw-r--r--src/ports/SkFontHost_linux.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/ports/SkFontHost_linux.cpp b/src/ports/SkFontHost_linux.cpp
index 2f962d7d40..4d4e6f171e 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]);