mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix: dont default to Font.default (#8401)
* fix: dont default to Font.default This would cause a font to be set for any label even when using default system font. This will also cause a typeface which is pretty long * lint: lint fixes * fix: added null font guards * fix: Used default bold for TabView Co-authored-by: Vasko <v.trifonov@gmail.com>
This commit is contained in:
@@ -176,6 +176,7 @@ export class ImageSource implements ImageSourceDefinition {
|
||||
}
|
||||
|
||||
static fromFontIconCodeSync(source: string, font: Font, color: Color): ImageSource {
|
||||
font = font || Font.default;
|
||||
const paint = new android.graphics.Paint();
|
||||
paint.setTypeface(font.getAndroidTypeface());
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
@@ -165,6 +165,7 @@ export class ImageSource implements ImageSourceDefinition {
|
||||
}
|
||||
|
||||
static fromFontIconCodeSync(source: string, font: Font, color: Color): ImageSource {
|
||||
font = font || Font.default;
|
||||
let fontSize = layout.toDevicePixels(font.fontSize);
|
||||
if (!fontSize) {
|
||||
// TODO: Consider making 36 font size as default for optimal look on TabView and ActionBar
|
||||
|
||||
Reference in New Issue
Block a user