em, rem, or % will be scaled according to the device setting. However, if you use absolute units such as px for font sizes, they generally won’t scale based on the device’s font size settings in Android.
The Font Scaling setting applies a specific scale to your app, independent of the device’s system settings. To force a default or unscaled version, set the Font Scaling setting to 100%.

Android font size device setting showing a "Largest" setting