0

I am working on a game on Unity and for that I have to detect if system default font boldness is enabled in accessibility or not. For checking that I am using fontWeightAdjustment like this

Configuration config = this.getResources().getConfiguration();
int fontWeight = config.fontWeightAdjustment;

but got to know it is available only from API31. I tested on API31 its working but what is the alternate way to know the same with older API level. This code is giving different result on different devices, like Samsung Galaxy S9 using Android 10 is throwing exception that its not found but One plus device running Android 10 is sending right bold value.

sanmeet
  • 200
  • 2
  • 13

0 Answers0