Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap : how Control the font size of the Mobile?

In Phonegap I have come across the problem, that if we change the font size of the mobile device from the setting to normal to large then the css which has applied to the application breaks.

So how to overcome this problem ? I have searched a lot but not able to find any solution regarding it.

Any help or advice would be helpful.

It works fine when device font-size is normal. Image here

As I change the device font-size from setting>Display>fonts to Huge Image here

like image 603
Anuj.T Avatar asked Mar 04 '15 06:03

Anuj.T


People also ask

What is used to control the elements font size?

The font-size property is used to control the size of fonts.

Which property is used to control the text size?

The font-size property is used to display the text in a larger size. The font-style property is used to display text in italics. The font-weight property is used to set how thick or thin characters in text should be displayed.


1 Answers

Just found out the solution exactly as i need. By using this plugin.

And Just write the following in your onDeviceReady function in index.js.

 if(window.MobileAccessibility){
        window.MobileAccessibility.usePreferredTextZoom(false);
    }

This will just ignore the system font preferences.

like image 148
Anuj.T Avatar answered Nov 15 '22 06:11

Anuj.T