From 3660ab79879aad9008c40fc8dd77633dbd0229ef Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Sun, 31 Dec 2023 17:44:10 -0800 Subject: [PATCH] [C-3462] Disable native font scaling --- packages/mobile/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/mobile/index.js b/packages/mobile/index.js index 6d63b0cda30..0e087265f52 100644 --- a/packages/mobile/index.js +++ b/packages/mobile/index.js @@ -7,7 +7,7 @@ import 'react-native-gesture-handler' // JS runtime check, which we disable here. import ViewReactNativeStyleAttributes from 'react-native/Libraries/Components/View/ReactNativeStyleAttributes' ViewReactNativeStyleAttributes.scaleY = true -import { AppRegistry, LogBox } from 'react-native' +import { AppRegistry, LogBox, Text } from 'react-native' import TrackPlayer from 'react-native-track-player' import { Crypto } from '@peculiar/webcrypto' @@ -32,5 +32,9 @@ LogBox.ignoreLogs(['new NativeEventEmitter']) // React Native debug tools LogBox.ignoreAllLogs() +// Prevent device font-scaling +Text.defaultProps = Text.defaultProps || {} +Text.defaultProps.allowFontScaling = false + AppRegistry.registerComponent(appName, () => App) TrackPlayer.registerPlaybackService(() => require('./audio-service'))