KB no longer maintained - MapViewer is a Legacy Product. Legacy Products are still supported, but no longer receive new features or updates. Many of MapViewer's features have been moved to Surfer. Please contact support@goldensoftware.com with any questions. |
You can create text with different font styles via automation. To do so, the Math Text commands must be used. Below is a script with some examples.
To run this script:
- Copy the text below, from the Sub Main start line to the End Sub end line.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\MapViewer 8\Scripter.
- Double click on Scripter.exe to launch Scripter.
- Press Ctrl+A to select all of the existing lines.
- Press Ctrl+V to paste your copied script over top of these existing lines.
- Click Script | Run to run the script.
*************
Sub Main
Dim mvApp, Plot As Object
Set mvApp = CreateObject("MapViewer.Application")
mvApp.Visible = True
'Opens a new plot window
Set Plot = mvApp.Documents.Add(mvDocPlot)
'Sets the Shapes variable
Set Shapes=Plot.Layers.ActiveLayer.Shapes
'Add a text object that contains two lines
Shapes.AddText(2,7,"This is a text block" + vbCrLf + "with two rows.")
'Add another text object that shows how to insert a symbol
Shapes.AddText(2,6,"This is a bullet \a183 in the middle of text")
'This example shows how to include bold , italics and strikethrough text
Shapes.AddText(2,5,"This is {\b bold}, {\i italic} and {\strike strikethrough} text.")
'This example shows how to insert the current date/time
Shapes.AddText(2,4,"This is the date: \date . This is the time: \time .")
'Insert user input data Min = "10" Max = "25"
Shapes.AddText(2,3,"Custom text from user input data: [" + Min + "] to [" + Max + "]")
'Change font in text
Shapes.AddText(2,2,"This is some text {\f" + Chr(34) + "Wingdings" + Chr(34) + " text} in a different font than the rest.")
End Sub
*************
For more information and other math text commands, see the Math Text Instruction Syntax page in MapViewer's online help. This page gives information about math text syntax. Click on the "math text instructions" link in the page for other math text commands.
Updated February 4, 2019
Comments
0 comments
Please sign in to leave a comment.