FIX: Buttons become boldy in android

This commit is contained in:
vakrilov
2017-06-27 15:55:17 +03:00
parent aa8fb024ad
commit 519dd6374f
2 changed files with 11 additions and 5 deletions

View File

@@ -6,10 +6,10 @@
"nativescript": {
"id": "org.nativescript.apps",
"tns-ios": {
"version": "2.4.0"
"version": "2.5.0"
},
"tns-android": {
"version": "2.4.1"
"version": "2.5.0"
}
},
"dependencies": {

View File

@@ -147,14 +147,20 @@ function createTypeface(font: Font): android.graphics.Typeface {
default:
result = loadFontFromFile(fonts[i]);
if (fontStyle) {
if (result && fontStyle) {
result = android.graphics.Typeface.create(result, fontStyle);
}
break;
}
// Found font!
if (result) {
break;
}
}
if (fontStyle && !result) {
if (!result) {
// fallback to sans-serif font with weight and style
result = android.graphics.Typeface.create("sans-serif" + getFontWeightSuffix(font.fontWeight), fontStyle);
}