akveo / akveo/react-native-ui-kitten
How do I load dynamic custom mapping for font sizes?
- 主要语言
- TypeScript
- 星标
- 10.7k
- 派生
- 962
- PR 合并指标
- 30 天内没有已合并 PR
描述
## 💬 Question
Hello there, recently I faced an issue due to native font scaling setting on my mobile app.

On the left, it is default font size on iOS simulator.
On the right it is the 'Largest' font setting set by user on their mobile.
Hence, I was thinking of using react-native's `fontScale` to check this setting and then set the font sizes according in a **custom mapping**. This is an example `metro.config.js` that I understood from the docs.
```
const evaConfig = {
evaPackage: '@eva-design/eva',
customMappingPath: './src/constants/evaMapping.json',
};
module.exports = MetroConfig.create(evaConfig, {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
});
```
However, with this approach, I cannot check the fontScale on run time and override the font-size values accordingly. Is there another workaround to this problem?
Thank you!
## UI Kitten and Eva version
```
"@eva-design/eva": "2.1.1",
"@ui-kitten/components": "5.1.2",
"@ui-kitten/eva-icons": "5.1.2",
"@ui-kitten/metro-config": "5.1.2",
```
贡献指南
评估
这个 Issue 还没有评估数据。