Chinese Simplified (简体中文)

FontStyle Object (IFontStyle Interface)

This object exposes properties of a font style.

Properties

Name Type Description
Application Engine, read-only Returns the Engine object.
Text decoration
Color int

Sets the RGB value of the color for the font.

The value of this property can be -1, which means that the color is transparent.

Note: The int value is calculated from the RGB triplet using the formula: (red value) + (256 x green value) + (65536 x blue value), where red value is the first triplet component, green value is the second triplet component, blue value is the third triplet component. For example, the int value of the color white equals 16777215.

By default, the font color is black, and the property returns 0.

IsBold VARIANT_BOOL Specifies whether the font is bold.
IsItalic VARIANT_BOOL Specifies whether the font is italic.
IsUnderlined VARIANT_BOOL Specifies whether the font is underlined.
IsStrikeout VARIANT_BOOL Specifies whether the font is strikeout.
IsSmallCaps VARIANT_BOOL Specifies whether the font has "small caps" style. This means that the small characters are displayed as small capitals.
Font attributes
FontName BSTR, read-only

Stores the name of the font. This property cannot be changed directly but via the SetFont method.

By default, this value is "Times New Roman".

FontSize int

Specifies the height of the font in twips. Twip is 1/20 of point, and point is 1/72".

Default value of this property corresponds to 10 points or 200 twips.

FontType FontTypeEnum, read-only

Stores the type of the font. This property cannot be changed directly but via the SetFont method.

By default, this value is FT_Unknown.

Base line, scaling and spacing
BaseLine int Sets the shift of a character from the base line of the string in pixels. The base line of the string is defined by the IParagraphLine::BaseLine property. This property is mainly used for the pictures embedded in text.
HorizontalScale int

Stores horizontal scaling the font style in 1/1000.

Default for this property is 1000, which corresponds to no scaling.

Spacing int

Specifies additional spacing between characters in twips. Twip is 1/20 of point, and point is 1/72".

Default value of this property is 0.

Style attributes
IsBaseFont VARIANT_BOOL, read-only Specifies whether this font style is the base font style of the paragraph style.
OverriddenStyleParams int, read-only Describes the set of the style parameters overridden in this style against the base font style of the paragraph. The property is an OR superposition of the StyleParamsEnum constants.

Methods

Name Description
SetFont Sets the new font name and font type.

Related objects

Object Diagram

See also

ParagraphStyle

Working with Properties

03.07.2024 8:50:10

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.