@evlop/native-components 1.0.275 → 1.0.277
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/Text/customFontManager.d.ts +10 -18
- package/dist/cjs/src/Text/customFontManager.d.ts.map +1 -1
- package/dist/cjs/src/Text/customFontManager.js +24 -31
- package/dist/cjs/src/Text/customFontManager.js.map +1 -1
- package/dist/cjs/src/Text/index.d.ts.map +1 -1
- package/dist/cjs/src/Text/index.js +14 -10
- package/dist/cjs/src/Text/index.js.map +1 -1
- package/dist/types/src/Text/customFontManager.d.ts +10 -18
- package/dist/types/src/Text/customFontManager.d.ts.map +1 -1
- package/dist/types/src/Text/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
declare type FontWeight = keyof Theme["fontWeights"];
|
|
1
|
+
declare type FontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
3
2
|
interface FontRegistration {
|
|
4
3
|
/** Base family name as embedded in the font file, e.g. "Inter" */
|
|
5
4
|
familyName: string;
|
|
@@ -21,32 +20,25 @@ declare class CustomFontManager {
|
|
|
21
20
|
* Register a font family. Call this once during app bootstrap, before
|
|
22
21
|
* any component that uses the font is rendered.
|
|
23
22
|
*
|
|
24
|
-
* @param name - Logical name used to look up the font (e.g. "primary")
|
|
25
23
|
* @param config - Registration config with familyName and optional weight map
|
|
26
24
|
*/
|
|
27
|
-
registerFont(
|
|
25
|
+
registerFont(config: FontRegistration): void;
|
|
28
26
|
/**
|
|
29
|
-
* Returns the
|
|
27
|
+
* Returns the family names of all registered fonts.
|
|
30
28
|
*/
|
|
31
29
|
getAvailableFontFamilies(): string[];
|
|
32
30
|
/**
|
|
33
|
-
*
|
|
34
|
-
* name, weight, and italic flag.
|
|
35
|
-
*
|
|
36
|
-
* Returns `undefined` if the font is not registered, letting React Native
|
|
37
|
-
* fall back to the system font.
|
|
38
|
-
*
|
|
39
|
-
* @param name - Logical font name as passed to `registerFont`
|
|
40
|
-
* @param fontWeight - One of the FontWeight variants
|
|
41
|
-
* @param italic - Whether to use the italic variant (default: false)
|
|
31
|
+
* Returns `true` if the given familyName has been registered as a custom font.
|
|
42
32
|
*/
|
|
33
|
+
isCustomFont(familyName: string): boolean;
|
|
43
34
|
/**
|
|
44
|
-
*
|
|
35
|
+
* Resolves the React Native font family string for a given familyName,
|
|
36
|
+
* weight, and italic flag.
|
|
45
37
|
*
|
|
46
|
-
*
|
|
38
|
+
* Returns `undefined` if the font is not registered, letting React Native
|
|
39
|
+
* fall back to the system font.
|
|
47
40
|
*/
|
|
48
|
-
|
|
49
|
-
resolveFontFamily(name: string, fontWeight: FontWeight, italic?: boolean): string | undefined;
|
|
41
|
+
resolveFontFamily(familyName: string, fontWeight: FontWeight, italic?: boolean): string | undefined;
|
|
50
42
|
}
|
|
51
43
|
export declare const customFontManager: CustomFontManager;
|
|
52
44
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customFontManager.d.ts","sourceRoot":"","sources":["../../../../src/Text/customFontManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customFontManager.d.ts","sourceRoot":"","sources":["../../../../src/Text/customFontManager.ts"],"names":[],"mappings":"AAEA,aAAK,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEtE,UAAU,gBAAgB;IACxB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;CAC3E;AAcD,cAAM,iBAAiB;IACrB,OAAO,CAAC,QAAQ,CAAuC;IAEvD;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAI5C;;OAEG;IACH,wBAAwB,IAAI,MAAM,EAAE;IAIpC;;OAEG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAIzC;;;;;;OAMG;IACH,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAQ,GAAG,MAAM,GAAG,SAAS;CAiBlG;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.customFontManager = void 0;
|
|
4
4
|
const DEFAULT_WEIGHT_SUFFIXES = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
100: { normal: 'Thin', italic: 'ThinItalic' },
|
|
6
|
+
200: { normal: 'UltraLight', italic: 'UltraLightItalic' },
|
|
7
|
+
300: { normal: 'Light', italic: 'LightItalic' },
|
|
8
|
+
400: { normal: 'Regular', italic: 'Italic' },
|
|
9
|
+
500: { normal: 'Medium', italic: 'MediumItalic' },
|
|
10
|
+
600: { normal: 'Semibold', italic: 'SemiboldItalic' },
|
|
11
|
+
700: { normal: 'Bold', italic: 'BoldItalic' },
|
|
12
|
+
800: { normal: 'Heavy', italic: 'HeavyItalic' },
|
|
13
|
+
900: { normal: 'Black', italic: 'BlackItalic' },
|
|
14
14
|
};
|
|
15
15
|
class CustomFontManager {
|
|
16
16
|
constructor() {
|
|
@@ -20,48 +20,41 @@ class CustomFontManager {
|
|
|
20
20
|
* Register a font family. Call this once during app bootstrap, before
|
|
21
21
|
* any component that uses the font is rendered.
|
|
22
22
|
*
|
|
23
|
-
* @param name - Logical name used to look up the font (e.g. "primary")
|
|
24
23
|
* @param config - Registration config with familyName and optional weight map
|
|
25
24
|
*/
|
|
26
|
-
registerFont(
|
|
27
|
-
this.registry.set(
|
|
25
|
+
registerFont(config) {
|
|
26
|
+
this.registry.set(config.familyName, config);
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
|
-
* Returns the
|
|
29
|
+
* Returns the family names of all registered fonts.
|
|
31
30
|
*/
|
|
32
31
|
getAvailableFontFamilies() {
|
|
33
32
|
return Array.from(this.registry.keys());
|
|
34
33
|
}
|
|
35
34
|
/**
|
|
36
|
-
*
|
|
37
|
-
* name, weight, and italic flag.
|
|
38
|
-
*
|
|
39
|
-
* Returns `undefined` if the font is not registered, letting React Native
|
|
40
|
-
* fall back to the system font.
|
|
41
|
-
*
|
|
42
|
-
* @param name - Logical font name as passed to `registerFont`
|
|
43
|
-
* @param fontWeight - One of the FontWeight variants
|
|
44
|
-
* @param italic - Whether to use the italic variant (default: false)
|
|
35
|
+
* Returns `true` if the given familyName has been registered as a custom font.
|
|
45
36
|
*/
|
|
37
|
+
isCustomFont(familyName) {
|
|
38
|
+
return this.registry.has(familyName);
|
|
39
|
+
}
|
|
46
40
|
/**
|
|
47
|
-
*
|
|
41
|
+
* Resolves the React Native font family string for a given familyName,
|
|
42
|
+
* weight, and italic flag.
|
|
48
43
|
*
|
|
49
|
-
*
|
|
44
|
+
* Returns `undefined` if the font is not registered, letting React Native
|
|
45
|
+
* fall back to the system font.
|
|
50
46
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
resolveFontFamily(name, fontWeight, italic = false) {
|
|
55
|
-
const registration = this.registry.get(name);
|
|
47
|
+
resolveFontFamily(familyName, fontWeight, italic = false) {
|
|
48
|
+
const registration = this.registry.get(familyName);
|
|
56
49
|
if (!registration) {
|
|
57
50
|
return undefined;
|
|
58
51
|
}
|
|
59
|
-
const {
|
|
52
|
+
const { weights } = registration;
|
|
60
53
|
const override = weights === null || weights === void 0 ? void 0 : weights[fontWeight];
|
|
61
54
|
if (override) {
|
|
62
55
|
return italic ? override.italic : override.normal;
|
|
63
56
|
}
|
|
64
|
-
const suffix = DEFAULT_WEIGHT_SUFFIXES[fontWeight];
|
|
57
|
+
const suffix = DEFAULT_WEIGHT_SUFFIXES[fontWeight] || DEFAULT_WEIGHT_SUFFIXES[400];
|
|
65
58
|
const variant = italic ? suffix.italic : suffix.normal;
|
|
66
59
|
return `${familyName}-${variant}`;
|
|
67
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customFontManager.js","sourceRoot":"","sources":["../../../../src/Text/customFontManager.ts"],"names":[],"mappings":";;;AAiBA,MAAM,uBAAuB,GAA2D;IACtF,
|
|
1
|
+
{"version":3,"file":"customFontManager.js","sourceRoot":"","sources":["../../../../src/Text/customFontManager.ts"],"names":[],"mappings":";;;AAiBA,MAAM,uBAAuB,GAA2D;IACtF,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAQ,MAAM,EAAE,YAAY,EAAQ;IACzD,GAAG,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE;IACzD,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,EAAO,MAAM,EAAE,aAAa,EAAO;IACzD,GAAG,EAAE,EAAE,MAAM,EAAE,SAAS,EAAK,MAAM,EAAE,QAAQ,EAAY;IACzD,GAAG,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAM,MAAM,EAAE,cAAc,EAAM;IACzD,GAAG,EAAE,EAAE,MAAM,EAAE,UAAU,EAAI,MAAM,EAAE,gBAAgB,EAAI;IACzD,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAQ,MAAM,EAAE,YAAY,EAAQ;IACzD,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,EAAO,MAAM,EAAE,aAAa,EAAO;IACzD,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,EAAO,MAAM,EAAE,aAAa,EAAO;CAC1D,CAAC;AAEF,MAAM,iBAAiB;IAAvB;QACU,aAAQ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 -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,KAAK,EAEN,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAc,eAAe,EAAU,WAAW,EAAS,UAAU,EAAiC,WAAW,EAAoC,UAAU,EAAa,eAAe,EAAW,MAAM,eAAe,CAAC;AACnO,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAMxD,aAAK,eAAe,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C,aAAK,eAAe,GAAG,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,eAAe,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,KAAK,EAEN,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAc,eAAe,EAAU,WAAW,EAAS,UAAU,EAAiC,WAAW,EAAoC,UAAU,EAAa,eAAe,EAAW,MAAM,eAAe,CAAC;AACnO,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAMxD,aAAK,eAAe,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C,aAAK,eAAe,GAAG,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,eAAe,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA+DlN,oBAAY,aAAa,GAAG,eAAe,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAMnE,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,aAAa,CAcvD,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,qBAAqB,CAAC,aAAa,CAgC1C,CAAC;AAEb,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B,eAAe,IAAI,CAAC"}
|
|
@@ -47,15 +47,19 @@ const resolveFontFamily = ({ fontFamily: fontFamilyProp, fontWeight: fontWeightP
|
|
|
47
47
|
const fontFamilyValue = fontFamilyProp !== null && fontFamilyProp !== void 0 ? fontFamilyProp : variantStyles.fontFamily;
|
|
48
48
|
const fontWeightValue = fontWeightProp !== null && fontWeightProp !== void 0 ? fontWeightProp : variantStyles.fontWeight;
|
|
49
49
|
const fontStyleValue = fontStyleProp !== null && fontStyleProp !== void 0 ? fontStyleProp : variantStyles.fontStyle;
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
const themeFonts = theme === null || theme === void 0 ? void 0 : theme.fonts;
|
|
51
|
+
const stylesToApply = {
|
|
52
|
+
fontFamily: themeFonts[fontFamilyValue] || fontFamilyValue,
|
|
53
|
+
fontWeight: theme.fontWeights[fontWeightValue] || fontWeightValue,
|
|
54
|
+
fontStyle: fontStyleValue,
|
|
55
|
+
};
|
|
56
|
+
if (stylesToApply.fontFamily === 'system')
|
|
57
|
+
return { fontWeight: stylesToApply.fontWeight, fontStyle: stylesToApply.fontStyle };
|
|
58
|
+
if (customFontManager_1.customFontManager.isCustomFont(stylesToApply.fontFamily)) {
|
|
59
|
+
const customFontFamily = customFontManager_1.customFontManager.resolveFontFamily(stylesToApply.fontFamily, stylesToApply.fontWeight, fontStyleValue === 'italic');
|
|
56
60
|
return customFontFamily ? { fontFamily: customFontFamily } : undefined;
|
|
57
61
|
}
|
|
58
|
-
return
|
|
62
|
+
return stylesToApply;
|
|
59
63
|
};
|
|
60
64
|
const StyledText = (0, native_1.default)(react_native_1.Text)(({ theme }) => {
|
|
61
65
|
var _a;
|
|
@@ -63,18 +67,18 @@ const StyledText = (0, native_1.default)(react_native_1.Text)(({ theme }) => {
|
|
|
63
67
|
// has to be like this for defaulting the color, we cannot override prop as text variant might apply color to it aswell.
|
|
64
68
|
color: (_a = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _a === void 0 ? void 0 : _a['gray-900'],
|
|
65
69
|
});
|
|
66
|
-
}, textVariant, resolveFontFamily, styled_system_1.border, styled_system_1.layout, styled_system_1.background, styled_system_1.color, fontSize, styled_system_1.
|
|
70
|
+
}, textVariant, resolveFontFamily, styled_system_1.border, styled_system_1.layout, styled_system_1.background, styled_system_1.color, fontSize, styled_system_1.letterSpacing, styled_system_1.textAlign, // these are typography from styled-system except fontWeight, fontFamily, lineHeight is handled by fontSize
|
|
67
71
|
styled_system_1.space);
|
|
68
72
|
const handlebarTemplateRegex = /{{[^{}]+}}/;
|
|
69
73
|
const testHandlebarTemplate = (0, lodash_1.memoize)((content) => typeof content === 'string' && handlebarTemplateRegex.test(content));
|
|
70
74
|
const BaseText = (_a) => {
|
|
71
|
-
var { children, content, fontFamily = 'primary' } = _a, props = __rest(_a, ["children", "content", "fontFamily"]);
|
|
75
|
+
var { children, content, fontFamily = 'primary', fontWeight = "Regular", fontStyle = "normal" } = _a, props = __rest(_a, ["children", "content", "fontFamily", "fontWeight", "fontStyle"]);
|
|
72
76
|
let displayValue = content || children;
|
|
73
77
|
const isTemplate = testHandlebarTemplate(displayValue);
|
|
74
78
|
if (isTemplate) {
|
|
75
79
|
displayValue = react_1.default.createElement(commons_1.RenderTemplate, { template: displayValue });
|
|
76
80
|
}
|
|
77
|
-
return (react_1.default.createElement(StyledText, Object.assign({ fontFamily: fontFamily }, props), displayValue));
|
|
81
|
+
return (react_1.default.createElement(StyledText, Object.assign({ fontFamily: fontFamily, fontWeight: fontWeight, fontStyle: fontStyle }, props), displayValue));
|
|
78
82
|
};
|
|
79
83
|
exports.BaseText = BaseText;
|
|
80
84
|
exports.Text = (0, commons_1.withSettings)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Text/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAKwB;AACxB,mCAAiC;AACjC,kDAA0B;AAC1B,+CAAwE;AACxE,sEAA8C;AAC9C,iDAAmO;AACnO,2DAAwD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Text/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAKwB;AACxB,mCAAiC;AACjC,kDAA0B;AAC1B,+CAAwE;AACxE,sEAA8C;AAC9C,iDAAmO;AACnO,2DAAwD;AA+H/C,kGA/HA,qCAAiB,OA+HA;AA7H1B,MAAM,WAAW,GAAG,IAAA,uBAAO,EAAC;IAC1B,KAAK,EAAE,cAAc;CACtB,CAAC,CAAC;AAMH,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,IAAI,EAAE,SAAS,GAAG,CAAC,EAAE,UAAU,GAAG,IAAI,EAAE,KAAK,EAAsC,EAAE,EAAE;IACpH,MAAM,SAAS,GAAG,QAA6C,CAAC;IAChE,IAAI,aAAa,GAAW,SAAmB,CAAC;IAChD,IAAI,SAAS,IAAI,KAAK,CAAC,SAAS,EAAE;QAChC,aAAa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E,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;YACjK,IAAI,EAAE,QAAQ;SACf;QACD;YACE,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;gBAChC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;gBACpC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;gBAClC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;aACvC;YACD,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC,CAAC,gBAAQ,CAAC,CAAC;AAIb,kBAAe,YAAI,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
declare type FontWeight = keyof Theme["fontWeights"];
|
|
1
|
+
declare type FontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
3
2
|
interface FontRegistration {
|
|
4
3
|
/** Base family name as embedded in the font file, e.g. "Inter" */
|
|
5
4
|
familyName: string;
|
|
@@ -21,32 +20,25 @@ declare class CustomFontManager {
|
|
|
21
20
|
* Register a font family. Call this once during app bootstrap, before
|
|
22
21
|
* any component that uses the font is rendered.
|
|
23
22
|
*
|
|
24
|
-
* @param name - Logical name used to look up the font (e.g. "primary")
|
|
25
23
|
* @param config - Registration config with familyName and optional weight map
|
|
26
24
|
*/
|
|
27
|
-
registerFont(
|
|
25
|
+
registerFont(config: FontRegistration): void;
|
|
28
26
|
/**
|
|
29
|
-
* Returns the
|
|
27
|
+
* Returns the family names of all registered fonts.
|
|
30
28
|
*/
|
|
31
29
|
getAvailableFontFamilies(): string[];
|
|
32
30
|
/**
|
|
33
|
-
*
|
|
34
|
-
* name, weight, and italic flag.
|
|
35
|
-
*
|
|
36
|
-
* Returns `undefined` if the font is not registered, letting React Native
|
|
37
|
-
* fall back to the system font.
|
|
38
|
-
*
|
|
39
|
-
* @param name - Logical font name as passed to `registerFont`
|
|
40
|
-
* @param fontWeight - One of the FontWeight variants
|
|
41
|
-
* @param italic - Whether to use the italic variant (default: false)
|
|
31
|
+
* Returns `true` if the given familyName has been registered as a custom font.
|
|
42
32
|
*/
|
|
33
|
+
isCustomFont(familyName: string): boolean;
|
|
43
34
|
/**
|
|
44
|
-
*
|
|
35
|
+
* Resolves the React Native font family string for a given familyName,
|
|
36
|
+
* weight, and italic flag.
|
|
45
37
|
*
|
|
46
|
-
*
|
|
38
|
+
* Returns `undefined` if the font is not registered, letting React Native
|
|
39
|
+
* fall back to the system font.
|
|
47
40
|
*/
|
|
48
|
-
|
|
49
|
-
resolveFontFamily(name: string, fontWeight: FontWeight, italic?: boolean): string | undefined;
|
|
41
|
+
resolveFontFamily(familyName: string, fontWeight: FontWeight, italic?: boolean): string | undefined;
|
|
50
42
|
}
|
|
51
43
|
export declare const customFontManager: CustomFontManager;
|
|
52
44
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customFontManager.d.ts","sourceRoot":"","sources":["../../../../src/Text/customFontManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customFontManager.d.ts","sourceRoot":"","sources":["../../../../src/Text/customFontManager.ts"],"names":[],"mappings":"AAEA,aAAK,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEtE,UAAU,gBAAgB;IACxB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;CAC3E;AAcD,cAAM,iBAAiB;IACrB,OAAO,CAAC,QAAQ,CAAuC;IAEvD;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAI5C;;OAEG;IACH,wBAAwB,IAAI,MAAM,EAAE;IAIpC;;OAEG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAIzC;;;;;;OAMG;IACH,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAQ,GAAG,MAAM,GAAG,SAAS;CAiBlG;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,KAAK,EAEN,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAc,eAAe,EAAU,WAAW,EAAS,UAAU,EAAiC,WAAW,EAAoC,UAAU,EAAa,eAAe,EAAW,MAAM,eAAe,CAAC;AACnO,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAMxD,aAAK,eAAe,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C,aAAK,eAAe,GAAG,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,eAAe,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Text/index.tsx"],"names":[],"mapp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