FontFormat Object

The FontFormat object contains the properties for text objects such as axes titles, axis labels, and contour labels.

The following table provides all properties of the FontFormat object.

Property

Description

Application

Returns the application object. It is a read only property.

BackColorRGBA

Returns the background RGBA color object. It is a read only property.

Bold

Returns/sets the bold style.

Color

Returns/sets the color as an RGB value. The Color property is superseded by the BackColorRGBA and ForeColorRGBA properties. Color has been preserved for backwards compatibility.

Face

Returns/sets the font face name.

ForeColorRGBA

Returns the foreground RGBA color object. It is a read only property.

Halign

Returns/sets the horizontal alignment.

Italic

Returns/sets the italic style.

Parent

Returns the parent object. It is a read only property.

Size

Returns/sets the font height in points.

StrikeThrough

Returns/sets the strike-through style.

Underline

Returns/sets the underline style.

VAlign

Returns/sets the vertical alignment.

Example

The following script demonstrates how the FontFormat object is used in reference to the BaseLayer object.

Sub Main

 

'Declares SurferApp as an object

Dim SurferApp As Object

 

'Creates an instance of the Surfer Application object and assigns it

'to the variable named "SurferApp"

Set SurferApp = CreateObject("Surfer.Application")

 

'Makes Surfer visible

SurferApp.Visible = True

 

'Declares Plot as an object

Dim Plot As Object

 

'Creates a plot document in Surfer and assigns it to the variable

'named "Plot"

Set Plot = SurferApp.Documents.Add(srfDocPlot)

 

'Declares Shapes as an object

Dim Shapes As Object

 

'Assigns the Shapes collection to the variable named "Shapes"

Set Shapes = Plot.Shapes

 

'Declares MapFrame as an object

Dim MapFrame As Object

 

'Creates a base map and assigns the map coordinate system to the

'variable named "MapFrame"

Set MapFrame = Shapes.AddBaseMap(ImportFileName:=SurferApp.Path+"\Samples\ca2010.gsb")

 

'Declares BaseLayer as an object

Dim BaseLayer As Object

 

'Assigns the base map properties to the variable named "BaseLayer"

Set BaseLayer = MapFrame.Overlays(1)

 

'Declares FontFormat as an object

Dim FontFormat As Object

 

'Assigns the font properties of the base map to the variable named

'"FontFormat"

Set FontFormat = BaseLayer.Font

 

End Sub