@@ -121,14 +121,14 @@ function loadFontFromFile(fontFamily: string, font: Font): android.graphics.Type
121
121
function createTypeface ( font : Font ) : android . graphics . Typeface {
122
122
const fontFamilies = parseFontFamily ( font . fontFamily ) ;
123
123
const fontWeight = font . fontWeight ;
124
- const supportsFontWeight = SDK_VERSION > 27 ;
124
+ const isNumericFontWeightSupported = SDK_VERSION > 27 ;
125
125
126
126
let result : android . graphics . Typeface ;
127
127
let fontStyle : number = 0 ;
128
128
// https://stackoverflow.com/questions/19691530/valid-values-for-androidfontfamily-and-what-they-map-to
129
129
let fontSuffix : string ;
130
130
131
- if ( supportsFontWeight ) {
131
+ if ( isNumericFontWeightSupported ) {
132
132
fontSuffix = '' ;
133
133
} else {
134
134
if ( font . isBold ) {
@@ -172,9 +172,9 @@ function createTypeface(font: Font): android.graphics.Typeface {
172
172
result = android . graphics . Typeface . create ( 'sans-serif' + fontSuffix , fontStyle ) ;
173
173
}
174
174
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 ) ;
178
178
}
179
179
180
180
return result ;
@@ -209,7 +209,7 @@ function getFontWeightSuffix(fontWeight: FontWeightType): string {
209
209
}
210
210
}
211
211
212
- function getFontWeightNumber ( fontWeight : FontWeightType ) : number {
212
+ function getNumericFontWeight ( fontWeight : FontWeightType ) : number {
213
213
let value : number ;
214
214
215
215
if ( typeof fontWeight === 'number' ) {
0 commit comments