IONIC - get the mobile OS font-size in app

I am building an ionic3 hybrid application and I would like to know if there is a way for the font-size to adjust based on the mobile’s operating systems font.

For example: In an iphone, if the text size is set to extra-large then I want the app to have extra-large fonts.

1 Like

Hm interesting question.

Doesn’t the Webview adapt automatically?
Does the browser adapt automatically and display websites with bigger fonts?

Well I thought the same, but unfortunately it does not. Webview does not adapt automatically nor does the browser display the websites with bigger fonts.

Apps like Facebook, Slack, whatsApp all change their font automatically to larger and smaller sizes. I know they are either made in react native, Xamarin or native. Is there any way this can be achieved in ionic 3?

If there is a Cordova plugin that gives you that value, you could easily adapt your CSS by adding a “big” class or something similar.

Where exactly does one change the font size? Right now I don’t really know what I am looking for.

This could be relevant:
(Note that there is an issue for this plugin as it is semi broken right now - but this would be fixable)

1 Like

Thanks Sujan, That plugin should be helpful. I hope it will be fixed as it is risky to use it in a live app.

I do what @Sujan12 mentioned in a v1 project.

I get the text scaling factor using Mobile Accessibility and then use that scale factor for certain classes and fixed height lists (like <collection-repeat> in v1 world)

1 Like

Did you run into any problem with that cordova plugin?

not so far - the app works on a whole bunch of android/ios devices

1 Like

Okay, thanks for the info, I will try that