akveo / akveo/react-native-ui-kitten

How do I load dynamic custom mapping for font sizes?

オープン
#1,618 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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.

Screenshot 2022-04-30 at 1 40 07 AM

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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。