Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 27th, 2005, 05:17 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
Default prevent font size change in Firefox

Hi all,
 How shall I prevent the font size change, which happens while pressing the ctrl button and scrolling the mouse?
 In IE it's only needed to assign a stylesheet to page contents but in firefox??
 
Old July 27th, 2005, 09:37 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

The philosophy of Mozilla, and other alternative browsers, as well as CSS itself, is that the user should always have control over the size of the font. Well, not only that, but anything design-related. In any browser, including Explorer, it is possible for the user to override any page style. A user's style preferences *can* take precedence over the page author's, and with font sizing they *always* take precedence over the author's. The simple truth is people with poor vision want to be able to read content.

The best way to design to accomodate fluctuations in the user's font size is using the 'em' unit, which is a measurement that is completely relative to the font size of a given page element. Using this measurement it is possible to design a document that scales completely with the user's font size setting.

Only thing is, it's really buggy and difficult to get cross-platform, pixel-perfect precision with (although, it can be done). IE 5.5 especially has difficulty with this measurement.

Explorer has the rather odd stance of not allowing certain measurements to scale. I suspect this will probably be improved in IE 7, but I'm not holding my breath.

So to get to the point, no it is not possible to prevent font size changes in Firefox or any of the other popular alternative browsers.

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
 
Old July 30th, 2005, 01:39 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well thanx but if you were to create a dynamic general purpose html tree including icons, labels, plus, minus and the conjunctions in between probably you would agree that scaling is impossible and would try to prevent it somehows. And there must be much better examples in which it's decided to prevent this and to prevent the whole component from breaking apart. I mean common there are some components on web which scaling is irrelevant.

 
Old July 30th, 2005, 10:10 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I don't agree. Scaling is possible in any type of application, given the application was approached taking into account said scalability. The fact remains that Firefox, Opera, Safari, and other browsers believe that the user should be in control of the font size and not the page author, and people with poor vision agree! It is possible to make a document zoom as though you were using something like photoshop to view it.

That said; I don't make all of my intranet apps scalable, eventhough it's possible. Perhaps I should, given that it is relatively trivial to pull off (with a fair amount of patience and tinkering) and it's always possible that someone will come along who thinks my font setting is far too small to read. In the end I wouldn't worry about it too much, few people know about the text zoom feature, and those that do are probably use to it breaking designs, but are willing to trade aesthetic nirvana for readability.

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design





Similar Threads
Thread Thread Starter Forum Replies Last Post
Font Size in buttons jmss66 Classic ASP Basics 4 September 20th, 2006 02:13 PM
how to get font ,color,font size of text in win32 satishsatao Visual C++ 0 April 5th, 2006 05:05 AM
Wscript.echo - How to change font size?? warewulf Beginning VB 6 0 December 27th, 2005 07:20 PM
Access Report Font Size ritag Access 2 November 5th, 2004 11:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.