font property
[This documentation is preliminary and is subject to change.]
Sets or retrieves a combination of separate font properties of the object. Alternatively, sets or retrieves one or more of six user-preference fonts.
Syntax
Integer value = object.put_font(BSTR v);Integer value = object.get_font(BSTR* p);
Property values
Type: BSTR
Up to six of the following space-delimited property values. Alternatively, sets or retrieves the six listed text fonts.
font-style (normal)
Any of the range of font-style values available to the font-style property.
font-variant (normal)
Any of the range of font-variant values available to the font-variant property.
font-weight (normal)
Any of the range of font-weight values available to the font-weight property.
font-size (medium)
Any of the range of font-size values available to the font-size property. When this value is an integer followed by a percent (%), the value is a percentage of the parent object's font size.
line-height (normal)
Any of the range of line-height values available to the line-height property. When used with the font property, this attribute must include a slash (/) before the value. Line height percentage values are calculated as a percentage of the font size of the element itself, not of the parent.
font-family ("Times New Roman")
Any of the range of font-family values available to the font-family property. This property can be set to multiple comma-separated values. Its default value depends on user settings.
caption
User-preference font used in objects that have captions—buttons, labels, and so on.
icon
User-preference font used in icon labels.
menu
User-preference font used in menus.
message-box
User-preference font used in dialog boxes.
small-caption
User-preference font used in small controls.
status-bar
User-preference font used in window status bars.
String format
[ [ font-style || font-variant || font-weight ]? font-size [ / line-height ]? font-family ] | caption | icon | menu | message-box | small-caption | status-bar
CSS information
Applies To | All elements |
Media | visual |
Inherited | 1 |
Initial Value |
Remarks
This is a composite property that specifies up to six font values. The font-style, font-variant, and font-weight values may appear in any order before font-size. However, the font-size, line-height, and font-family properties must appear in the order listed. Setting the font property also sets the component properties. In this case, the string must be a combination of valid values for the component properties; only font-family may have more than one value. If the string does not contain a value for a component property, that property is set to its default, regardless of prior settings for that component property.
Requirements
Minimum supported client |
Windows XP |
Minimum supported server |
Windows Server 2003 |
Header |
|
DLL |
Mshtml.dll |
See also
CSS Values and Units Reference
Build date: 1/23/2012