am ca4b9a77: am e92c8542: am 01825b7a: Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]

* commit 'ca4b9a77e7d20703287b33b203b2582bd43f7792':
  Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]
This commit is contained in:
Deepanshu Gupta
2014-02-20 17:49:27 +00:00
committed by Android Git Automerger

View File

@ -57,7 +57,9 @@ public final class FontLoader {
private static final String FONT_SUFFIX_NONE = ".ttf"; private static final String FONT_SUFFIX_NONE = ".ttf";
private static final String FONT_SUFFIX_REGULAR = "-Regular.ttf"; private static final String FONT_SUFFIX_REGULAR = "-Regular.ttf";
private static final String FONT_SUFFIX_BOLD = "-Bold.ttf"; private static final String FONT_SUFFIX_BOLD = "-Bold.ttf";
private static final String FONT_SUFFIX_ITALIC = "-Italic.ttf"; // FONT_SUFFIX_ITALIC will always match FONT_SUFFIX_BOLDITALIC and hence it must be checked
// separately.
private static final String FONT_SUFFIX_ITALIC = "Italic.ttf";
private static final String FONT_SUFFIX_BOLDITALIC = "-BoldItalic.ttf"; private static final String FONT_SUFFIX_BOLDITALIC = "-BoldItalic.ttf";
// This must match the values of Typeface styles so that we can use them for indices in this // This must match the values of Typeface styles so that we can use them for indices in this
@ -285,10 +287,10 @@ public final class FontLoader {
mFontInfo.font[Typeface.NORMAL] = font; mFontInfo.font[Typeface.NORMAL] = font;
} else if (fileName.endsWith(FONT_SUFFIX_BOLD)) { } else if (fileName.endsWith(FONT_SUFFIX_BOLD)) {
mFontInfo.font[Typeface.BOLD] = font; mFontInfo.font[Typeface.BOLD] = font;
} else if (fileName.endsWith(FONT_SUFFIX_ITALIC)) {
mFontInfo.font[Typeface.ITALIC] = font;
} else if (fileName.endsWith(FONT_SUFFIX_BOLDITALIC)) { } else if (fileName.endsWith(FONT_SUFFIX_BOLDITALIC)) {
mFontInfo.font[Typeface.BOLD_ITALIC] = font; mFontInfo.font[Typeface.BOLD_ITALIC] = font;
} else if (fileName.endsWith(FONT_SUFFIX_ITALIC)) {
mFontInfo.font[Typeface.ITALIC] = font;
} else if (fileName.endsWith(FONT_SUFFIX_NONE)) { } else if (fileName.endsWith(FONT_SUFFIX_NONE)) {
mFontInfo.font[Typeface.NORMAL] = font; mFontInfo.font[Typeface.NORMAL] = font;
} }