SetDefaultFont Method

Window

SetDefaultFont is declared for the Browser window.

Action

Sets the fonts to the shipped defaults for the browser.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

browser.SetDefaultFont ( )

Notes

SetDefaultFont sets the fonts to the defaults that are shipped with the browser, as follows:

Browser Action by SetDefaultFont
Internet Explorer Sets the font size to Medium.
Mozilla Firefox

For the variable-width font, sets the serif font to 16-point Times New Roman and sets the Sans Serif font to 16-point Tahoma.

Sets the fixed-width font to 10-point Courier New.

This method is called automatically by the recovery system (in DefaultBaseState) if your application’s main page has the constant bDefaultFont declared and set to TRUE.

By default, when you generate a test frame, the declaration for bDefaultFont is commented out. If you want the recovery system to set the fonts, uncomment the declaration and assign it the value TRUE. Having the recovery system set the fonts to the defaults ensures maximum portability of your window declarations in different testing sessions and between browsers.

You can also call the method manually.

Example

Browser.SetActive ()
Browser.SetDefaultFont ()

// Result:
// Fonts are set to the defaults.