summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authorjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-16 17:42:35 +0000
committerjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-16 17:42:35 +0000
commitce16e809676fe3dd03c6a4fcb99580c600ecb91c (patch)
tree5ffa1a3b73e7a439b800565bef676b86fd79e12c /skia
parentc99eb84ef887d8b0f58a17d7b1492d7ae8f07bb9 (diff)
downloadchromium_src-ce16e809676fe3dd03c6a4fcb99580c600ecb91c.zip
chromium_src-ce16e809676fe3dd03c6a4fcb99580c600ecb91c.tar.gz
chromium_src-ce16e809676fe3dd03c6a4fcb99580c600ecb91c.tar.bz2
Map Liberation Sans Mono and Ascender Sans Mono to Courier New.
They're metrically compatible with each other, but the former is sans serif (monospace) while ther latter is serif (monospace), which is why we didn't include this mapping in the two previous CLs (one by Evan and the other by me). However, on ChromeOS, we use 'Ascender Sans Mono' as a substitute for Courier New so that they have to be regarded as 'identical'. Without this change, a text node styled with 'Courier New' is not rendered with our replacement font while a text node styled with 'Courier New, momospace' or 'monospace' is rendered with our replacement font. BUG=cros:4006 TEST=See the bug. Review URL: http://codereview.chromium.org/2838003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49975 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/SkFontHost_fontconfig_direct.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/skia/ext/SkFontHost_fontconfig_direct.cpp b/skia/ext/SkFontHost_fontconfig_direct.cpp
index 279af90..7231bc2 100644
--- a/skia/ext/SkFontHost_fontconfig_direct.cpp
+++ b/skia/ext/SkFontHost_fontconfig_direct.cpp
@@ -33,7 +33,8 @@ enum FontEquivClass
{
OTHER,
SANS,
- SERIF
+ SERIF,
+ MONO
};
// Match the font name against a whilelist of fonts, returning the equivalence
@@ -50,9 +51,12 @@ FontEquivClass GetFontEquivClass(const char* fontname)
// /etc/fonts/conf.d/30-metric-aliases.conf
// from my Ubuntu system, but we're better off being very conservative.
- // "Ascender Sans" and "Ascender Serif" are the tentative names of
- // another set of fonts metric-compatible with Arial and Times New Roman
- // with a character repertoire much larger than Liberation.
+ // "Ascender Sans", "Ascender Serif" and "Ascender Sans Mono" are the
+ // tentative names of another set of fonts metric-compatible with
+ // Arial, Times New Roman and Courier New with a character repertoire
+ // much larger than Liberation. Note that Ascender Sans Mono
+ // is metrically compatible with Courier New, but the former
+ // is sans-serif while ther latter is serif.
if (strcasecmp(fontname, "Arial") == 0 ||
strcasecmp(fontname, "Liberation Sans") == 0 ||
strcasecmp(fontname, "Ascender Sans") == 0) {
@@ -61,6 +65,9 @@ FontEquivClass GetFontEquivClass(const char* fontname)
strcasecmp(fontname, "Liberation Serif") == 0 ||
strcasecmp(fontname, "Ascender Serif") == 0) {
return SERIF;
+ } else if (strcasecmp(fontname, "Courier New") == 0 ||
+ strcasecmp(fontname, "Ascender Sans Mono") == 0) {
+ return MONO;
}
return OTHER;
}