Message-ID: <800899558.7591.1711613873140.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_7590_591637424.1711613873140" ------=_Part_7590_591637424.1711613873140 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The Font class is used to specify form= atting that should be applied to a character run. It also represents the fo= nts of named styles in the document.
=20public sealed class Font=20
Public NotInheritable Class Font=20
There are two ways to obtain an instance of this class. The Document.CreateFon=
t() method creates a new Font
object based on the Normal s=
tyle. 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 characte=
r 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.
=20//--- Get Normal font from Document WordApplication app =3D new WordApplication(); Document doc =3D app.Create(); Font normalFont =3D doc.CreateFont(); //--- Get font from Heading1 Style WordApplication app =3D new WordApplication(); Document doc =3D app.Create(); Font heading1Font =3D doc.Styles[NamedStyle.BuiltIn.Heading1].Fon= t;=20
'--- Get Normal font from Document Dim app As New WordApplication() Dim doc As Document =3D app.Create() Dim normalFont As Font =3D doc.CreateFont() '--- Get font from Heading1 Style Dim app As New WordApplication() Dim doc As Document =3D app.Create() Dim heading1Font As Font =3D doc.Styles(NamedStyle.BuiltIn.Headin= g1).Font=20
Name | =20
Description | =20
---|---|
=20 | Sets or returns a Font.TextAnimation object that represents the text animat= ion for a character run. | =20
Bold= p> | =20
Sets or returns a boolean that repr=
esents if a character run is bolded. | =20
=20 | Returns a B= order object on which you can manipulate the border properties of a cha= racter run. | =20
Caps= p> | =20
Sets or returns a boolean that repr=
esents if a character run has the All caps effect, formatting lowercase tex=
t as capital letters and reducing their size. All caps formatting does not =
affect numbers, punctutation, non-alphabetic chacters, or uppercase letters=
. | =20
=20 | Sets or returns an int that represe=
nts the character scaling, stretching or compressing text horizontally as a=
percentage of its current size. CharacterScaling can be set to a value bet=
ween 1 and 600 percent. Values beyond these will be automatically adjusted.=
| =20
=20 | Sets or returns an int that represe=
nts the spacing between characters in a character run in twips. One twip =
=3D (1/20 pt) or ( 1/1440 in). This number can be negative (decreased spaci=
ng) or positive (increased spacing). | =20
=20 | Sets or returns a boolean that repr=
esents if a character run has the Double strikethrough effect, displaying a=
double line through the text. | =20
=20 | Sets or returns a boolean that repr=
esents if a character run has the Emboss effect, displaying the text as if =
it is raised off the page in relief. | =20
=20 | Sets or returns a boolean that repr=
esents if a character run has the Engrave effect, making the text to be imp=
rinted or pressed into the page. | =20
=20 | Sets or returns a String that repre=
sents the name of the font used in this formatting. | =20
=20 | Sets or returns an float that repre=
sents the font size for a character run. The font size will always be a mul=
tiple of 0.5. | =20
=20 | Sets or returns a boolean that repr=
esents if a character run has the Hidden effect set. If set to true, this f=
ont will only be displayed when the display hidden flag is turned on for th=
e containing document. | =20
=20 | Sets or returns the highlight color for a charac= ter run as a Color object= . | =20
=20 | Sets or returns a Font.Hyphenation object that represents the hyphenation rul= e for a character run. | =20
=20 | Sets or returns a boolean that repr=
esents if a character run is italicized. | =20
=20 | Sets or returns a double that repre=
sents the kerning threshold for a character run in points. | =20
=20 | Sets or returns a boolean that repr=
esents if Word will not perform grammar and spell checking on a character r=
un when the document is opened. | =20
=20 | Sets or returns a boolean that repr=
esents 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.) | =20
=20 | Returns a = Shading object which on which you can manipulate the shading (fill colo= r and/or pattern) properties of a character run. | =20
=20 | Sets or returns a boolean that repr=
esents if a character run has the Shadow effect, displaying a shadow behind=
, beneath and to the right of each character. | =20
=20 | Sets or returns a boolean that repr=
esents if a character run has the Small caps effect, formatting lowercase t=
ext as capital letters and reducing their size. Small caps formatting does =
not affect numbers, punctutation, non-alphabetic chacters, or uppercase let=
ters. | =20
=20 | Sets or returns a ScriptType object that represents whether the text in this f= ormatting is set to superscript, subscript, or none. | =20
=20 | Sets or returns a boolean that repr=
esents if a character run has the Strikethrough effect, displaying a single=
line through the text. | =20
=20 | Sets or returns the color of the text in a chara= cter run as a Color objec= t. | =20
=20 | Sets or returns a Font.UnderlineType= object that represents the underline type for this formatting. | =20
=20 | Sets or returns the underline color for a charac= ter run as a Color object= . | =20
=20 | Sets or returns a double that repre=
sents 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.) | =20
Name | =20
Description | =20
---|---|
=20 | Types of hyphenation rules that can be applied t= o a character run. | =20
=20 | Values used to represent whether a character run= is formatting as superscript, subscript, or neither. | =20
=20 | Types of text animation that can be set on a cha= racter run. | =20
=20 | Types of underlines that can be applied to a cha= racter run. | =20