Focal Point
Help. Detecting browser font size

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8601076691

November 15, 2006, 01:02 PM
Commando Dave
Help. Detecting browser font size
Does anybody have a trick to detect the browsers text-size setting. That is, how to determine the browser's current setting of the menu option: view...text-size... smallest, smaller, medium, larger, largest.

...OR...

Is there a way to make the font sizes on the page fixed/unaffected by the setting of the browsers "text-size"?
November 15, 2006, 01:18 PM
Francis Mariani
The Web Browser text size does not have any impact when using 'pixel' as the unit of measure in CSS styling.

E.G.:
TABLE FILE CAR
SUM
SALES AS 'Sales'
BY COUNTRY AS 'Country'
HEADING
"Car Sales By Country"
ON TABLE SET PAGE NOLEAD
ON TABLE HOLD AS H001 FORMAT HTMTABLE
ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=OFF, $
TYPE=DATA, CLASS=cssData, $
TYPE=TITLE, CLASS=cssTitle, $
TYPE=HEADING, CLASS=cssHeading, $
ENDSTYLE
END
-RUN
-HTMLFORM BEGIN
<HTML>
<HEAD>
<STYLE>
BODY { font-family: Arial, sans-serif; font-size: 12px; }
TD { font-size: 12px; }
.cssHeading { font-size: 14px; font-weight: bold; color: blue; }
U { text-decoration: none; }
.cssTitle { font-size: 12px; font-weight: bold; color: navy; }
.cssData { font-size: 12px; }
</STYLE>
</HEAD>
<BODY>
!IBI.FIL.H001;
</BODY>
</HTML>
-HTMLFORM END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 15, 2006, 02:20 PM
Commando Dave
Thanks Francis! As to my first question (detecting browser setting) I'm surprised to find little. Have seen a few tidbits where a change is detected but not an api to the font-size setting, that I can find. like the screen object, for example, to determine resolution.

eg...

<script type="text/javascript">
function whatsize()
{
alert( screen.AvailHeight + ' by ' + screen.AvailWidth );
}



-cDave
November 15, 2006, 02:30 PM
Francis Mariani
cDave,

This website discusses font resizing: http://alistapart.com/articles/fontresizing


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server