8000 chore: Minor variable naming changes · NativeScript/NativeScript@b12c415 · GitHub
[go: up one dir, main page]

Skip to content

Commit b12c415

Browse files
CatchABusNathanWalker
authored andcommitted
chore: Minor variable naming changes
1 parent f776ab9 commit b12c415

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/core/ui/styling/font.android.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ function loadFontFromFile(fontFamily: string, font: Font): android.graphics.Type
121121
function createTypeface(font: Font): android.graphics.Typeface {
122122
const fontFamilies = parseFontFamily(font.fontFamily);
123123
const fontWeight = font.fontWeight;
124-
const supportsFontWeight = SDK_VERSION > 27;
124+
const isNumericFontWeightSupported = SDK_VERSION > 27;
125125

126126
let result: android.graphics.Typeface;
127127
let fontStyle: number = 0;
128128
// https://stackoverflow.com/questions/19691530/valid-values-for-androidfontfamily-and-what-they-map-to
129129
let fontSuffix: string;
130130

131-
if (supportsFontWeight) {
131+
if (isNumericFontWeightSupported) {
132132
fontSuffix = '';
133133
} else {
134134
if (font.isBold) {
@@ -172,9 +172,9 @@ function createTypeface(font: Font): android.graphics.Typeface {
172172
result = android.graphics.Typeface.create('sans-serif' + fontSuffix, fontStyle);
173173
}
174174

175-
// Newer versions can accept a specific font weight number
176-
if (supportsFontWeight) {
177-
result = android.graphics.Typeface.create(result, getFontWeightNumber(fontWeight), font.isItalic);
175+
// Newer android versions can accept a numeric font weight
176+
if (isNumericFontWeightSupported) {
177+
result = android.graphics.Typeface.create(result, getNumericFontWeight(fontWeight), font.isItalic);
178178
}
179179

180180
return result;
@@ -209,7 +209,7 @@ function getFontWeightSuffix(fontWeight: FontWeightType): string {
209209
}
210210
}
211211

212-
function getFontWeightNumber(fontWeight: FontWeightType): number {
212+
function getNumericFontWeight(fontWeight: FontWeightType): number {
213213
let value: number;
214214

215215
if (typeof fontWeight === 'number') {

0 commit comments

Comments
 (0)
0