diff options
author | Deepanshu Gupta <deepanshu@google.com> | 2014-02-20 17:42:54 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-02-20 17:42:54 +0000 |
commit | e92c8542a5cf1160a1b701b9f176af64ba46d68d (patch) | |
tree | 1f447504c9d0ee228c9a290dfd0fe3be06a67804 | |
parent | 24a8e1d0e9a32c571403bfc730ce18dd138a529c (diff) | |
parent | 01825b7aa3c864426c78c08c2f6004a8362c2b47 (diff) | |
download | frameworks_base-e92c8542a5cf1160a1b701b9f176af64ba46d68d.zip frameworks_base-e92c8542a5cf1160a1b701b9f176af64ba46d68d.tar.gz frameworks_base-e92c8542a5cf1160a1b701b9f176af64ba46d68d.tar.bz2 |
am 01825b7a: Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]
* commit '01825b7aa3c864426c78c08c2f6004a8362c2b47':
Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]
-rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java | 8 |
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 108b651..cc7338a 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 @@ -57,7 +57,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 @@ -285,10 +287,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; } |