homepage Welcome to WebmasterWorld Guest from 54.145.183.126
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Is there a way of returning browser text size
horseatingweeds

5+ Year Member



 
Msg#: 3440178 posted 6:43 pm on Sep 3, 2007 (gmt 0)

I've found a chronic problem with using em is that many users have their browser font size inadvertently set to a large or small size. This then leads the user to wonder why the incompetent web designer decided to use HUGE or very small text.

Is there any way to return such a setting value to the page?

 

penders

WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



 
Msg#: 3440178 posted 9:47 am on Sep 4, 2007 (gmt 0)

...users have their browser font size inadvertently set to a large or small size.

IMO, the user should be educated in the use of their browser!

How would you tell the difference between a user who had 'inadvertently' incorrectly set their default font size to one who had set it intentionally, because they have a problem with small text?

You could perhaps offer an advisery comment at best.

It is possible to read the font-size of a particular element, but only in FF will this increase if the default browser font-size increases. In both IE6 and Opera the returned font-size is the same, regardless of the browser default. So, in practise, I don't think that even an 'advisory comment' is worth the effort, particularly since those who don't know how to use their browser are more likely to be using IE! (I've not tried IE7)

horseatingweeds

5+ Year Member



 
Msg#: 3440178 posted 7:22 pm on Sep 4, 2007 (gmt 0)

IMO, the user should be educated in the use of their browser!

Indeed!

However, this does not seem to be the case. The majority of users know just enough about their technology to barely get what they need out of it. My first use for such a attribute would be compiling some statistics on my users, or possibly correcting super small text.

Another solution could be a fount control on each page. I've seen these on other site but have never written one. I imagine one could use Javascript or in combination with server side such as php, which writes some css.

Has anyone written one of these and found it useful? I plan to put a survey on the site in hopes to discover these ridiculous problems, but a user finding a microscopic website or old-folk key-pad looking site, likely, would just hit the back button, assuming such a ninny knows about that function.

penders

WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



 
Msg#: 3440178 posted 9:35 am on Sep 5, 2007 (gmt 0)

It is possible to read the font-size of a particular element, but only in FF will this increase if the default browser font-size increases. In both IE6 and Opera the returned font-size is the same, regardless of the browser default. So, in practise, I don't think that even an 'advisory comment' is worth the effort, particularly since those who don't know how to use their browser are more likely to be using IE! (I've not tried IE7)

IE7 behaves the same as IE6 in this case. The font-size returned is the same, regardless of the default size set in the browser (...Medium, Larger, Largest)

My first use for such a attribute would be compiling some statistics on my users, or possibly correcting super small text.

FF (for which the above font-size test works) has a minimum font-size setting in the browser anyway. This appears to be enabled by default in FF2, but I'm not sure that it is in FF1.5. Op9 also has a minimum font-size setting which is enabled by default.

IE7 has 3 new accessibility settings worth noting...

  • [ ] Reset text size to Medium for new windows & tabs. (However, this does *not* seem to be enabled by default.)
  • [x] Reset text size to Medium while zooming. (Enabled by default)
  • [x] Reset zoom level to 100% for new windows & tabs. (Enabled by default)

I would have thought that most IE7 users will be 'zooming' rather than changing the text size, since this is far more accessible (bottom right of main window) and has replaced the Ctrl+MouseWheel shortcut which previously altered the text-size.

Another solution could be a fount control on each page. I've seen these on other site but have never written one. I imagine one could use Javascript or in combination with server side such as php, which writes some css.

A 'font control' which effects just your site. And save the value in a cookie for when the visitor returns. But your font setting should still be relative to whatever default font-size is set in the browser. IE6 doesn't allow style switching in the browser, so you can essentially emulate this with code. But FF and Op do, so I think it is still important to maintain this functionality in those browsers. For the most part it is a nice convenience for your users, and shows you've tried, but if the user uses your control to correct a misconfigured browser then they aren't really solving the problem, but hey. Also, for someone who really needs larger text because of sight issues then they are likely to be already familier with browser shortcuts to change the font-size.

horseatingweeds

5+ Year Member



 
Msg#: 3440178 posted 5:18 pm on Sep 5, 2007 (gmt 0)

I've been experimenting. Small text is not a problem in FF. The smallest text is still readable.

IE is different though. Ctrl + -/+ changes things properly, but zoom (Ctrl + scroll) screws things up. What is zoom doing differently?

I've tried other website and they seem to have the zoom controlled so that you can't make it super small or too large.

How is this done?

penders

WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



 
Msg#: 3440178 posted 11:11 pm on Sep 5, 2007 (gmt 0)

IE is different though. Ctrl + -/+ changes things properly, but zoom (Ctrl + scroll) screws things up. What is zoom doing differently?

From my experience... in IE6, Ctrl + -/+ does nothing. Ctrl + scroll changes the text size, between the 5 different sizes (Smallest to Largest).

In IE7, Ctrl + +/- actually controls the zoom, not the text size. The same as using Ctrl + scroll. The only way to specifically change the text size is to go via the menu - AFAIK there is no shortcut for this. Although you say you are getting a different result when using the keyboard shortcut, to when you use the mouse? Do you have a mouse driver which is overriding this?

The new zoom feature in IE7 'attempts' to resize everything, including the graphics - although I'm not sure that it always manages forms too well.

In IE7, the zoom is reset back to 100% when the user restarts the browser. It seems that... the text size is also reset to Medium if the zoom is reset. However, if the zoom is not reset (ie. it was previously set at 100%) then the text size remains as it was.

Opera has only ever had the zoom feature, and does it very well. It also doesn't cause a horizontal scroll as it does it IE7.

I've tried other website and they seem to have the zoom controlled so that you can't make it super small or too large.

Hhhmmm, not sure how you can control the "zoom".

Certainly if you are accommodating varying text sizes then ensuring you have a fluid enough layout to handle expanding text and if your text size is reasonable at the 'Medium' setting then it should be at least readable at the 'Smallest'.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved