Description
The Font class is used to specify formatting that should be applied to a character run. It also represents the fonts of named styles in the document.
Remarks
There are two ways to obtain an instance of this class. The Document.CreateFont() method creates a new Font
object based on the Normal style. Alternately, using NamedStyle.Font, you can create a Font
object that is a copy of a particular style's font. The Font
object that is returned can then be used in conjunction with methods in the Element class to create character runs, paragraphs, etc, with specific fonts.
The following example demonstrates both ways of getting a font, first by retrieving the Normal style's font from the document, second by retrieving a copy of the Heading1 style's font.
Examples
Properties
Name |
Description |
---|---|
Sets or returns a Font.TextAnimation object that represents the text animation for a character run. | |
Sets or returns a boolean that represents if a character run is bolded. |
|
Returns a Border object on which you can manipulate the border properties of a character run. | |
Sets or returns a boolean that represents if a character run has the All caps effect, formatting lowercase text as capital letters and reducing their size. All caps formatting does not affect numbers, punctutation, non-alphabetic chacters, or uppercase letters. |
|
Sets or returns an int that represents the character scaling, stretching or compressing text horizontally as a percentage of its current size. CharacterScaling can be set to a value between 1 and 600 percent. Values beyond these will be automatically adjusted. |
|
Sets or returns an int that represents the spacing between characters in a character run in twips. One twip = (1/20 pt) or ( 1/1440 in). This number can be negative (decreased spacing) or positive (increased spacing). |
|
Sets or returns a boolean that represents if a character run has the Double strikethrough effect, displaying a double line through the text. |
|
Sets or returns a boolean that represents if a character run has the Emboss effect, displaying the text as if it is raised off the page in relief. |
|
Sets or returns a boolean that represents if a character run has the Engrave effect, making the text to be imprinted or pressed into the page. |
|
Sets or returns a String that represents the name of the font used in this formatting. |
|
Sets or returns an float that represents the font size for a character run. The font size will always be a multiple of 0.5. |
|
Sets or returns a boolean that represents if a character run has the Hidden effect set. If set to true, this font will only be displayed when the display hidden flag is turned on for the containing document. |
|
Sets or returns the highlight color for a character run as a Color object. | |
Sets or returns a Font.Hyphenation object that represents the hyphenation rule for a character run. | |
Sets or returns a boolean that represents if a character run is italicized. |
|
Sets or returns a double that represents the kerning threshold for a character run in points. |
|
Sets or returns a boolean that represents if Word will not perform grammar and spell checking on a character run when the document is opened. |
|
Sets or returns a boolean that represents if a character run has the the Outline effect, displaying the inner and outer borders of each character. (This effect is not available for all fonts.) |
|
Returns a Shading object which on which you can manipulate the shading (fill color and/or pattern) properties of a character run. | |
Sets or returns a boolean that represents if a character run has the Shadow effect, displaying a shadow behind, beneath and to the right of each character. |
|
Sets or returns a boolean that represents if a character run has the Small caps effect, formatting lowercase text as capital letters and reducing their size. Small caps formatting does not affect numbers, punctutation, non-alphabetic chacters, or uppercase letters. |
|
Sets or returns a ScriptType object that represents whether the text in this formatting is set to superscript, subscript, or none. | |
Sets or returns a boolean that represents if a character run has the Strikethrough effect, displaying a single line through the text. |
|
Sets or returns the color of the text in a character run as a Color object. | |
Sets or returns a Font.UnderlineType object that represents the underline type for this formatting. | |
Sets or returns the underline color for a character run as a Color object. | |
Sets or returns a double that represents the vertical position for a character run in half points, lowering or raising the text in relation to the baseline. (For example, 2 points would be 4 half points.) |
Nested Classes
Name |
Description |
---|---|
Types of hyphenation rules that can be applied to a character run. | |
Values used to represent whether a character run is formatting as superscript, subscript, or neither. | |
Types of text animation that can be set on a character run. | |
Types of underlines that can be applied to a character run. |