CHARFORMAT2 structure

Contains information about character formatting in a rich edit control.CHARFORMAT2 is a Microsoft Rich Edit 2.0 extension of the CHARFORMAT structure. Microsoft Rich Edit 2.0 allows you to use either structure with the EM_GETCHARFORMAT and EM_SETCHARFORMAT messages.

Members

Specifies the size, in bytes, of the structure. Before passing this structure to a rich edit control, set cbSize to the size of the CHARFORMAT or CHARFORMAT2 structure. If cbSize equals the size of a CHARFORMAT structure, the control uses only the CHARFORMAT members.

Specifies the parts of the CHARFORMAT2 structure that contain valid information. The
dwMask member can be a combination of the values from two sets of bit flags. One set indicates the structure members that are valid. Another set indicates the valid attributes in the
dwEffects member.

Set the following values to indicate the valid attributes of the dwEffects member.

A set of bit flags that specify character effects. Some of the flags are included only for compatibility with Microsoft Text Object Model (TOM) interfaces; the rich edit control stores the value but does not use it to display text.

This member can be a combination of the following values.

Value

Meaning

CFE_ALLCAPS

Characters are all capital letters. The value does not affect the way the control displays the text. This value applies only to versions earlier than Microsoft Rich Edit 3.0.

CFE_AUTOBACKCOLOR

The background color is the return value of GetSysColor(COLOR_WINDOW). If this flag is set, crBackColor member is ignored.

CFE_AUTOCOLOR

The text color is the return value of GetSysColor(COLOR_WINDOWTEXT). If this flag is set, the crTextColor member is ignored.

CFE_BOLD

Characters are bold.

CFE_DISABLED

Characters are displayed with a shadow that is offset by 3/4 point or one pixel, whichever is larger.

CFE_EMBOSS

Characters are embossed. The value does not affect how the control displays the text.

CFE_EXTENDED

The characters are less common members of a script. A font that supports a script should check if it has glyphs for such characters.

CFE_FONTBOUND

Font is chosen by the rich edit control because the active font doesn’t support the characters. This process is called font binding.

CFE_HIDDEN

For Microsoft Rich Edit 3.0 and later, characters are not displayed.

CFE_IMPRINT

Characters are displayed as imprinted characters. The value does not affect how the control displays the text.

CFE_ITALIC

Characters are italic.

CFE_LINK

A rich edit control can send EN_LINK notification codes when it receives mouse messages while the mouse pointer is over text with the CFE_LINK effect.

CFE_LINKPROTECTED

Characters are part of a friendly name link.

CFE_MATH

Characters are in a math zone.

CFE_MATHNOBUILDUP

Characters do not participate in a math build up. For example, when applied to a /, the / will not be used to build up a fraction.

CFE_MATHORDINARY

Characters are displayed as ordinary text within a math zone.

CFE_OUTLINE

Characters are displayed as outlined characters. The value does not affect how the control displays the text.

CFE_PROTECTED

Characters are protected; an attempt to modify them will cause an EN_PROTECTED notification code.

CFE_REVISED

Characters are marked as revised.

CFE_SHADOW

Characters are displayed as shadowed characters. The value does not affect how the control displays the text.

CFE_SMALLCAPS

Characters are in small capital letters. The value does not affect how the control displays the text.

CFE_STRIKEOUT

Characters are struck out.

CFE_SUBSCRIPT

Characters are subscript. The CFE_SUPERSCRIPT and CFE_SUBSCRIPT values are mutually exclusive. For both values, the control automatically calculates an offset and a smaller font size. Alternatively, you can use the yHeight and yOffset members to explicitly specify font size and offset for subscript and superscript characters.

Character offset from the baseline, in twips. If the value of this member is positive, the character is a superscript; if the value is negative, the character is a subscript. To use this member, set the CFM_OFFSET flag in the dwMask member.

Horizontal space between letters, in twips. This value has no effect on the text displayed by a rich edit control; it is included for compatibility with Windows TOM interfaces. To use this member, set the CFM_SPACING flag in the dwMask member.

A 32-bit locale identifier that contains a language identifier in the lower word and a sorting identifier and reserved value in the upper word. This member has no effect on the text displayed by a rich edit control, but spelling and grammar checkers can use it to deal with language-dependent problems. You can use the macro to create an LCID value. To use this member, set the CFM_LCID flag in the dwMask member.

Character style handle. This value has no effect on the text displayed by a rich edit control; it is included for compatibility with WindowsTOM interfaces. To use this member, set the CFM_STYLE flag in the dwMask member. For more information see the TOM documentation.

Value of the font size, above which to kern the character (yHeight). This value has no effect on the text displayed by a rich edit control; it is included for compatibility with TOM interfaces. To use this member, set the CFM_KERNING flag in the dwMask member.

Text animation type. This value has no effect on the text displayed by a rich edit control; it is included for compatibility with TOM interfaces. To use this member, set the CFM_ANIMATION flag in the dwMask member.

An index that identifies the author making a revision. The rich edit control uses different text colors for each different author index. To use this member, set the CFM_REVAUTHOR flag in the dwMask member.