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 還沒有評估資料。