akveo / akveo/react-native-ui-kitten
How do I load dynamic custom mapping for font sizes?
- Dominant language
- TypeScript
- Stars
- 10.7k
- Forks
- 962
- PR merge metrics
- No merged PRs in 30d
Description
## 💬 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",
```
Contributor guide
Assessment
This issue has not been assessed yet.