Font Property

The Font property contains the font of the displayed text.


    document.all["id_name"].Font [=IFontDisp] 
Possible Values
    IFontDisp that specifies or retrieves the font for the text.

    The property is read/write.
    Since the Font property is an IFontDisp interface, access to the properties of the interface is possible. They are as follows:
    Name, Size, Bold, Italic, Underline, Strikethrough, Weight and Charset.
    The following example creates a StaticText ActiveX Control to demonstrate the possibilities. In this case the font name will be changed after 10 seconds and the text be displayed with the new font.

    <SCRIPT TYPE="text/javascript">
    function changeFont()
    	if(document.all["id_StaticText"].Font.Name == 
    	"Times New Roman")
    		document.all["id_StaticText"].Font.Name = "Arial";
    		document.all["id_StaticText"].Text = 
    		document.all["id_StaticText"].Font.Name = 
    		"Times New Roman";
    		document.all["id_StaticText"].Text = 
    <OBJECT id="id_StaticText" width="170" height="12" 
    style="padding:0; margin:0; display:inline;" 
    	<PARAM NAME="BackStyle" VALUE="0">
    	<PARAM NAME="BackColor" VALUE="0">
    	<PARAM NAME="FontName" VALUE="Times New Roman">
    	<PARAM NAME="FontSize" VALUE="8.00">
    	<PARAM NAME="FontBold" VALUE="0">
    	<PARAM NAME="FontItalic" VALUE="0">
    	<PARAM NAME="FontUnderline" VALUE="0">
    	<PARAM NAME="FontWeight" VALUE="500">
    	<PARAM NAME="ForeColor" VALUE="0">
    	<PARAM NAME="Text" VALUE="Default text if necessary">
    <div onclick="changeFont()">Click to change fonts!</div>

Applies to
    SiteKiosk v5.0 (and later versions).

Back to top