MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / getNumericFontWeight

Function getNumericFontWeight

packages/core/ui/styling/font.android.ts:240–262  ·  view source on GitHub ↗
(fontWeight: FontWeightType)

Source from the content-addressed store, hash-verified

238}
239
240function getNumericFontWeight(fontWeight: FontWeightType): number {
241 let value: number;
242
243 if (typeof fontWeight === 'number') {
244 value = fontWeight;
245 } else {
246 switch (fontWeight) {
247 case FontWeight.NORMAL:
248 case undefined:
249 case null:
250 value = 400;
251 break;
252 case FontWeight.BOLD:
253 value = 700;
254 break;
255 default:
256 value = parseInt(fontWeight);
257 break;
258 }
259 }
260
261 return value;
262}

Callers 1

createTypefaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected