diff --git a/apps/package.json b/apps/package.json index 38571241d..082edd2e2 100644 --- a/apps/package.json +++ b/apps/package.json @@ -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": { @@ -24,4 +24,4 @@ "nativescript-dev-typescript": "^0.3.0", "typescript": "^2.0.3" } -} \ No newline at end of file +} diff --git a/tns-core-modules/ui/styling/font.android.ts b/tns-core-modules/ui/styling/font.android.ts index 0467e78a9..70a7c1209 100644 --- a/tns-core-modules/ui/styling/font.android.ts +++ b/tns-core-modules/ui/styling/font.android.ts @@ -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); }