summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2014-05-13 16:31:47 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-13 16:31:47 +0000
commit45ca5ba7dc3b70dd39991217894eed114eefb1b8 (patch)
tree23bd68b348d6e143b4dbf27c43fde5fde70abd14 /tools
parent9f9652587dd08e5a4f7c8195eb904cd0f0c3f6c4 (diff)
parent01cdd3123f408dc41a2bd4786f3a943157ab6c69 (diff)
downloadframeworks_base-45ca5ba7dc3b70dd39991217894eed114eefb1b8.zip
frameworks_base-45ca5ba7dc3b70dd39991217894eed114eefb1b8.tar.gz
frameworks_base-45ca5ba7dc3b70dd39991217894eed114eefb1b8.tar.bz2
am 01cdd312: am 669792b3: Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]
* commit '01cdd3123f408dc41a2bd4786f3a943157ab6c69': Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]
Diffstat (limited to 'tools')
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java
index 081ce67..2244aa2 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java
@@ -55,7 +55,9 @@ public final class FontLoader {
private static final String FONT_SUFFIX_NONE = ".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_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";
// This must match the values of Typeface styles so that we can use them for indices in this
@@ -267,10 +269,10 @@ public final class FontLoader {
mFontInfo.font[Typeface.NORMAL] = font;
} else if (fileName.endsWith(FONT_SUFFIX_BOLD)) {
mFontInfo.font[Typeface.BOLD] = font;
- } else if (fileName.endsWith(FONT_SUFFIX_ITALIC)) {
- mFontInfo.font[Typeface.ITALIC] = font;
} else if (fileName.endsWith(FONT_SUFFIX_BOLDITALIC)) {
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)) {
mFontInfo.font[Typeface.NORMAL] = font;
}