浏览代码

feat: adaptive font size

Oleksandr Honcharov 1 年之前
父节点
当前提交
223c8bb566
共有 2 个文件被更改,包括 5 次插入0 次删除
  1. 1 0
      src/utils/index.ts
  2. 4 0
      src/utils/responsive-font.ts

+ 1 - 0
src/utils/index.ts

@@ -1 +1,2 @@
 export * from './request';
+export * from './responsive-font';

+ 4 - 0
src/utils/responsive-font.ts

@@ -0,0 +1,4 @@
+import { PixelRatio } from 'react-native';
+
+const fontScale = PixelRatio.getFontScale();
+export const getFontSize = (size: number) => size / fontScale;