vba source
[List][Prev][Next]
Setting text fonts [ Preview ]

This example gets the current font values for the active text style and then changes the typeface for the font to "PlayBill." The new font is then set using the SetFont method. To see the effects of changing the typeface, add some MText or Text to your current drawing before running the example. Note that, if you don't have the PlayBill font on your system, you need to substitute a font you do have in order for this example to work.

Sub Ch4_UpdateTextFont()

MsgBox ("Look at the text now...")

Dim typeFace As String
Dim SavetypeFace As String
Dim Bold As Boolean
Dim Italic As Boolean
Dim charSet As Long
Dim PitchandFamily As Long

' Get the current settings to fill in the
' default values for the SetFont method
ThisDrawing.ActiveTextStyle.GetFont typeFace, _
Bold, Italic, charSet, PitchandFamily

' Change the typeface for the font
SavetypeFace = typeFace
typeFace = "PlayBill"
ThisDrawing.ActiveTextStyle.SetFont typeFace, _
Bold, Italic, charSet, PitchandFamily
ThisDrawing.Regen acActiveViewport
MsgBox ("Now see how it looks after changing the font...")

'Restore the original typeface
ThisDrawing.ActiveTextStyle.SetFont SavetypeFace, _
Bold, Italic, charSet, PitchandFamily
ThisDrawing.Regen acActiveViewport
End Sub


-----------------------

You can modify an existing style by changing the properties of the TextStyle object. You can also update existing text of that style type to reflect the changes. Use the following properties to modify a TextStyle object:

FontFile

Specifies the file associated with a font (character style).

BigFontFile

Specifies the special shape definition file used for a non-ASCII character set, such as Kanji.

Height

Specifies the character height.

Width

Specifies the expansion or compression of the characters.

ObliqueAngle

Specifies the slant of the characters.

TextGenerationFlag

Specifies backward text, upside-down text, or both.


<%//# DataBinder.Eval(Container.DataItem, "album_title") %>
<%//# DataBinder.Eval(Container.DataItem, "contenttype") + " views" %>
link list for hairwigbeautyshop.com ::
Javascript Source List :