'How to allow only positive font-scaling in react native Text Component

Android and iOS have OS-Accessibility-Settings for adapted font-sizes.

I know, that generally we do not want to block this, however:

  • when a text is fairly large already, I want to block further positive font-scaling and
  • when it is fairly small already, I want to block negative font-scaling.

We can disable font-scaling completely on a React Native component by adding allowFontScaling={false} as a prop. Also we can limit/block positive fontScaling with e.g. maxFontSizeMultiplier={1.2}.

Is there any way to ONLY allow positive font-scaling and block negative font-scaling only ?

I have tried with minimumFontScale. This prop however is only added for when we use adjustsFontSizeToFit which is not my use case.

I would be happy for any sort of help - thank you :-)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source