Added option for system font

This commit is contained in:
Moez Bhatti
2015-11-14 18:58:58 -05:00
parent 3fe54127b5
commit f39ef9cbca
3 changed files with 8 additions and 6 deletions
@@ -123,7 +123,7 @@ public class FontManager {
// Otherwise, get the heavy font weight.
if (fontWeight == TypefaceManager.TextWeight.LIGHT) {
return TypefaceManager.TextWeight.NORMAL;
} else if (fontFamily == TypefaceManager.FontFamily.ROBOTO || fontFamily == TypefaceManager.FontFamily.LATO) {
} else if (fontFamily == TypefaceManager.FontFamily.ROBOTO) {
return TypefaceManager.TextWeight.MEDIUM;
} else {
return TypefaceManager.TextWeight.BOLD;
@@ -23,8 +23,10 @@ public class TypefaceManager {
public static android.graphics.Typeface obtainTypeface(int fontFamily, int textWeight) throws IllegalArgumentException {
int typeface = Typefaces.ROBOTO_REGULAR;
switch (fontFamily) {
case FontFamily.SYSTEM_FONT:
break;
case FontFamily.ROBOTO:
case FontFamily.LATO:
switch (textWeight) {
case TextWeight.NORMAL:
typeface = Typefaces.ROBOTO_REGULAR;
@@ -94,9 +96,9 @@ public class TypefaceManager {
}
public class FontFamily {
public static final int ROBOTO = 0;
public static final int ROBOTO_CONDENSED = 1;
public static final int LATO = 2;
public static final int SYSTEM_FONT = 0;
public static final int ROBOTO = 1;
public static final int ROBOTO_CONDENSED = 2;
}
public class TextWeight {
+1 -1
View File
@@ -753,9 +753,9 @@
</string-array>
<string-array name="font_families">
<item>System font</item>
<item>Roboto Regular</item>
<item>Roboto Condensed</item>
<item>Lato</item>
</string-array>
<string-array name="font_weights">