IFontDisp

This interface exposes a font object's properties through Automation. It provides a subset of the IFont methods.

When to Implement

A font object implements this interface along with IFont to provide access to the font's properties through Automation. Typically, it is not necessary to implement this interface on your own object, since there is a COM-provided implementation of the font object.

The following table describes the dispIDs for the various font properties.

Symbol Value
DISPID_FONT_NAME 0
DISPID_FONT_SIZE 2
DISPID_FONT_BOLD 3
DISPID_FONT_ITALIC 4
DISPID_FONT_UNDER 5
DISPID_FONT_STRIKE 6
DISPID_FONT_WEIGHT 7
DISPID_FONT_CHARSET 8

Each property in the IFontDisp interface includes a get_PropertyName method if the property supports read access and a put_PropertyName method if the property supports write access. Most of the properties support both read and write access and thus expose both "get" and "put" methods for these properties.


Property

Type
Access Allowed
Description
Name BSTR RW The facename of the font, e.g. Arial.
Size CY RW The point size of the font, expressed in a CY type to allow for fractional point sizes.
Bold BOOL RW Indicates whether the font is boldfaced.
Italic BOOL RW Indicates whether the font is italicized.
Underline BOOL RW Indicates whether the font is underlined.
Strikethrough BOOL RW Indicates whether the font is strikethrough.
Weight short RW The boldness of the font.
Charset short RW The character set used in the font, such as ANSI_CHARSET, DEFAULT_CHARSET, or SYMBOL_CHARSET.

When to Use

Use this interface to change or retrieve the properties of a font object through the IDispatch::Invoke method in Automation.

Methods in Vtable Order

IUnknown Methods Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments reference count.
Release Decrements reference count.

QuickInfo

  Windows NT: Use version 4.0 or later.
  Windows: Use Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in ocidl.h.

See Also

IFont