English

How To: Make CompositeMarker symbols from TrueType fonts [SCRIPT]

Procedure

How can I make CompositeMarker symbols from TrueType font marker symbols?

Answer:

Open your Marker Palette. Use the Palette Manager and the Font Palette's "Create Markers" button to ensure that your Marker Palette contains all of the TrueType marker symbols you want to work with. Once your Marker Palette looks the way you want, run the script below called "Layout.MarkerDump".

This script will create one or more Layouts in your project which will display all of the markers currently in your palette. Each marker symbol in this 'dump' will also be labeled with its ASCII decimal code. If you print these layouts, they can serve as a handy reference guide later when you begin to construct CompositeMarker symbols. If your Marker Palette also contains markers which are not TrueType symbols, the script will still dump them into a Layout, but the ASCII code for them will be incorrect.

Modify the "MakeCompMarker.ave" script in order to make the composite markers and enter them into the current Marker Palette. In the example below "m1" is the symbol which will be on the bottom of the two. The symbol "m2" will be on top of the two. Note that in each group of Avenue requests you will get the opportunity to:

1) Set the marker style of each. For TrueType marker symbols, this will always
be "#BASICMARKER_STYLE_PATTERN".

2) Set the size of each. They can be of different size.

3) Set the color of each, whether or not that color is locked. If it is not locked you will be able to use the Color Palette to change the color later.

4) Set the font of each. They may be different fonts, so long as the font you enter here exists on your system.

5) Set the character of each. The printed layouts created using the "Layout.MarkerDump" script contain the numbers you will use for the "SetCharacter" request.

Both scripts are below.

'--- SCRIPT: LAYOUT.MARKERDUMP
'--- Title: Dumps markers from palette to layout
'--- Topics: Graphics
'--- Description: This script allows you to dump the contents of a Marker
'--- Palette into a layout. Specifically, graphics are generated and
'--- symbolized with each marker from the palette; there will be one graphic
'--- per marker. Each marker is labeled with its ASCII decimal code.
'--- Multiple layouts will be created to accomodate additional symbols
'--- Requires: A Marker Palette containing only TrueType font symbols.

thePalette = av.GetSymbolWin.GetPalette

thePaletteList = thePalette.GetList(#PALETTE_LIST_MARKER)
numPages = (thePaletteList.Count / 60).Ceiling

pageCount = 0
symNum = 0
MakeNewPage = true
xp = 0

While (pageCount < numPages)
if (MakeNewPage) then
theLayout = Layout.Make
pageCount = pageCount + 1
end 'if makenewpage
MakeNewPage = false
theLayout.GetWin.open
theLayout.SetName("MARKER"+((pageCount).AsString))

dis = theLayout.GetDisplay
dis.SetPageSize(8.5@11)
dis.SetMarginVisible(FALSE)
gl = theLayout.GetGraphics

'--- Make a bounding box
boundX = (750 - (8.50 / 2))
boundY = (750 + (11.00 / 2))
bboundX = (750 + (8.50 / 2))
bboundY = (750 - (11.00 / 2))
boundBox = Rect.MakeXY(boundX, boundY, bboundX, BBoundY)
gBoundBox = GraphicShape.Make(boundBox)
gl.AddBatch(gboundBox)

'--- Make framing box
topX = (750 - (8.50 / 2)) + 0.50
topY = (750 + (11.00 / 2)) - 0.50
botX = (750 + (8.50 / 2)) - 0.50
botY = (750 - (11.00 / 2)) + 0.50
box = Rect.MakeXY(topX, topY, botX, botY)
gbox = GraphicShape.Make(box)
gl.AddBatch(gbox)

dx = 1.25 'X distance change
dy = 0.99 'Y distance change

originX = 750 - (8.50 / 2)
originY = 750 + (11.00 / 2)

x = originX + 0.75
y = originY - 1.3
tX = x + 2.0
tY = originY - 0.75
tPt = (tX@tY)
gtPt = GraphicText.Make
("Markers with their Decimal ASCII codes", tPt)
gl.AddBatch(gtPt)

'--- Create rectangle
xMin = x
yMin = y
xMax = x + 0.75
yMax = y + 0.5
r = Rect.MakeXY(xMin, yMin, xMax, yMax)
gr = GraphicShape.Make(r)

l = (x@y) + (0.3@0.25)
gPoint = GraphicShape.Make(l)
for each ROW in 1..10
for each COLUMN in 0..5
nextRec = gr.clone
nextPoint = gPoint.clone
nextPoint.setSymbol(thePaletteList.Get(symNum))
nextPoint.GetSymbol.SetSize(30)
a = nextPoint.GetSymbol.GetCharacter
offsetPt = (x@y)
nextRec.setOrigin(offsetPt)
secondPt = (x@y) + (0.3@0.25)
nextPoint.setOrigin(secondPt)
pt = offsetPt + (0.25@0) - (0@0.25)
t = GraphicText.Make(a.asstring, pt) '****
gl.UnselectAll
gl.AddBatch(nextRec)
gl.AddBatch(nextPoint)
gl.Addbatch(t)
x = x + dx
symNum = symNum + 1
if (symNum = thePaletteList.Count) then exit end
end 'for each COLUMN
x = originX + 0.75
y = y - dy
end 'for each ROW
if (symNum < ((thePaletteList.Count) - 1) ) then
MakeNewPage = true
end 'Per Page
end 'While
gl.UnSelectAll
av.GetProject.SetModified(true)
gl.EndBatch
'
'--- End Of Script: LAYOUT.MARKERDUMP

'--- SCRIPT: MAKECOMPMARKER.AVE
av.GetSymbolWin.Open
av.GetSymbolWin.SetPanel(#SYMBOLWIN_PANEL_MARKER)

'--- Set the properties of each marker symbol according to your requirements

'--- "m1" is for the background symbol
m1 = BasicMarker.Make
m1.SetStyle(#BASICMARKER_STYLE_PATTERN)
m1.SetSize(16)
m1.SetColor(Color.GetWhite)
m1.SetFont(Font.Make("MyFontName","normal"))
m1.SetColorLock(false) '--- This allows you to control the color later
m1.SetCharacter(75) '--- This is the ASCII decimal number for that symbol

'--- "m2" is for the foreground symbol
m2 = BasicMarker.Make
m2.SetStyle(#BASICMARKER_STYLE_PATTERN)
m2.SetSize(16)
m2.SetColor(Color.GetBlack)
m2.SetFont(Font.Make("MyFontName","normal"))
m2.SetColorLock(true) '--- This freezes the color
m2.SetCharacter(71) '--- This is the ASCII decimal number for that symbol

'--- Make as many marker symbols as there are layers in your composite symbol
cm = CompositeMarker.Make(SymbolList.FromList({m1,m2}))
mp = av.GetSymbolWin.GetPalette.GetList(#PALETTE_LIST_MARKER)
mp.Add(cm)
av.GetSymbolWin.RefreshPalette(#PALETTE_LIST_MARKER)
'
'--- End Of Script: MAKECOMPMARKER.AVE