mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
FIX: Buttons become boldy in android
This commit is contained in:
@@ -6,10 +6,10 @@
|
|||||||
"nativescript": {
|
"nativescript": {
|
||||||
"id": "org.nativescript.apps",
|
"id": "org.nativescript.apps",
|
||||||
"tns-ios": {
|
"tns-ios": {
|
||||||
"version": "2.4.0"
|
"version": "2.5.0"
|
||||||
},
|
},
|
||||||
"tns-android": {
|
"tns-android": {
|
||||||
"version": "2.4.1"
|
"version": "2.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -147,14 +147,20 @@ function createTypeface(font: Font): android.graphics.Typeface {
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
result = loadFontFromFile(fonts[i]);
|
result = loadFontFromFile(fonts[i]);
|
||||||
if (fontStyle) {
|
if (result && fontStyle) {
|
||||||
result = android.graphics.Typeface.create(result, fontStyle);
|
result = android.graphics.Typeface.create(result, fontStyle);
|
||||||
}
|
}
|
||||||
break;
|
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);
|
result = android.graphics.Typeface.create("sans-serif" + getFontWeightSuffix(font.fontWeight), fontStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user