Cordova: minimum font-size

664 views
Skip to first unread message

gab nonameok

unread,
Jul 29, 2014, 4:04:11 AM7/29/14
to phon...@googlegroups.com

Hi,

I write this code in HTML file:

<p style="font-size: 1px;">Little</p>
<p style="font-size: 6px;">Normal</p>
<p style="font-size: 11px;">Big</p>
<p style="font-size: 16px;">Very big</p>


In PC, we can't see "little" (too small), we can see "normal" but it's little and we can see "big" and "very big". That is normal.

The problem is in Cordova, the text "little" and "normal" display with the same size.

I noticed that the text which have a size under about 9px, display with a size of 9px.

It seems that Cordova affect a minimum size (about 9px).

Do you know this problem?

How can I write a text with a little size (lower 9px)?

Thanks



Kerri Shotts

unread,
Jul 29, 2014, 2:41:17 PM7/29/14
to phon...@googlegroups.com
Not a Cordova issue.

I suppose it could be a system web browser issue with a minimum font size -- but since you don't indicate the platform this occurs on and the version of the OS, it's hard to know.

gab nonameok

unread,
Jul 30, 2014, 9:20:51 AM7/30/14
to phon...@googlegroups.com
Sorry,
I use a acer iconiatab with android 4.1.1.

I may be wrong but Cordova don't use a web browser? It's an app not a website? Sorry if I'm wrong.

I just install a remote debuguer (Weinre) and it is written:
  1. font-size: 8px;
    1. element.style - 6px
    2. body - 14px (strikethrough)
    3. html - medium (strikethrough)
    4. html - 10px (strikethrough)
In fact, it founds 6px but put 8px for the fontsize of the text without indicate where it found the famous 8px.

Thanks.

Kerri Shotts

unread,
Aug 1, 2014, 2:11:22 PM8/1/14
to phon...@googlegroups.com
Cordova uses the /system web view/ to be exact. This means you inherit the same limitations, quirks, issues, etc., that the system web view has on the platform you are targeting. Which means that if your web view has a minimum font size (for whatever reason), then you are subject to the same.

First, don't use 1px font sizes to hide text. Second, this is old, but it might help? http://stackoverflow.com/questions/3796176/how-to-change-the-fontsize-in-an-android-webview

Of course if Acer has decided to get in the way of all that, it's entirely possible you can't override it at all. I had a problem back in the 2.x days with HTC insisting on skinning text boxes and ignoring ALL CSS code. There was NO fix -- my only option was a different rom. I doubt that's the case here, but giving you a head's up just-in-case.
Reply all
Reply to author
Forward
0 new messages