forked from upstream-mirrors/quik
Added option for system font
This commit is contained in:
@@ -123,7 +123,7 @@ public class FontManager {
|
|||||||
// Otherwise, get the heavy font weight.
|
// Otherwise, get the heavy font weight.
|
||||||
if (fontWeight == TypefaceManager.TextWeight.LIGHT) {
|
if (fontWeight == TypefaceManager.TextWeight.LIGHT) {
|
||||||
return TypefaceManager.TextWeight.NORMAL;
|
return TypefaceManager.TextWeight.NORMAL;
|
||||||
} else if (fontFamily == TypefaceManager.FontFamily.ROBOTO || fontFamily == TypefaceManager.FontFamily.LATO) {
|
} else if (fontFamily == TypefaceManager.FontFamily.ROBOTO) {
|
||||||
return TypefaceManager.TextWeight.MEDIUM;
|
return TypefaceManager.TextWeight.MEDIUM;
|
||||||
} else {
|
} else {
|
||||||
return TypefaceManager.TextWeight.BOLD;
|
return TypefaceManager.TextWeight.BOLD;
|
||||||
|
|||||||
@@ -23,8 +23,10 @@ public class TypefaceManager {
|
|||||||
public static android.graphics.Typeface obtainTypeface(int fontFamily, int textWeight) throws IllegalArgumentException {
|
public static android.graphics.Typeface obtainTypeface(int fontFamily, int textWeight) throws IllegalArgumentException {
|
||||||
int typeface = Typefaces.ROBOTO_REGULAR;
|
int typeface = Typefaces.ROBOTO_REGULAR;
|
||||||
switch (fontFamily) {
|
switch (fontFamily) {
|
||||||
|
case FontFamily.SYSTEM_FONT:
|
||||||
|
break;
|
||||||
|
|
||||||
case FontFamily.ROBOTO:
|
case FontFamily.ROBOTO:
|
||||||
case FontFamily.LATO:
|
|
||||||
switch (textWeight) {
|
switch (textWeight) {
|
||||||
case TextWeight.NORMAL:
|
case TextWeight.NORMAL:
|
||||||
typeface = Typefaces.ROBOTO_REGULAR;
|
typeface = Typefaces.ROBOTO_REGULAR;
|
||||||
@@ -94,9 +96,9 @@ public class TypefaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class FontFamily {
|
public class FontFamily {
|
||||||
public static final int ROBOTO = 0;
|
public static final int SYSTEM_FONT = 0;
|
||||||
public static final int ROBOTO_CONDENSED = 1;
|
public static final int ROBOTO = 1;
|
||||||
public static final int LATO = 2;
|
public static final int ROBOTO_CONDENSED = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TextWeight {
|
public class TextWeight {
|
||||||
|
|||||||
@@ -753,9 +753,9 @@
|
|||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="font_families">
|
<string-array name="font_families">
|
||||||
|
<item>System font</item>
|
||||||
<item>Roboto Regular</item>
|
<item>Roboto Regular</item>
|
||||||
<item>Roboto Condensed</item>
|
<item>Roboto Condensed</item>
|
||||||
<item>Lato</item>
|
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="font_weights">
|
<string-array name="font_weights">
|
||||||
|
|||||||
Reference in New Issue
Block a user