'Changes the font face and size for all labels/titles/text '(other than Grid Values map labels and base map labels) Sub Main 'Initializes Surfer Dim SurferApp, Plot, MapFrame As Object Set SurferApp =CreateObject("Surfer.Application") SurferApp.Visible = True '================================== 'User-defined variables '================================== filepath$ = "C:\temp\" filename$ = "Plot1.srf" fontface$ = "Arial" fontsize = 10 '================================== 'Opens the Surfer file Set Plot = SurferApp.Documents.Open(filepath$+filename$) 'Loops through all of the objects in the project For i=1 To Plot.Shapes.Count 'If the object is a map... If Plot.Shapes.Item(i).Type=srfShapeMapFrame Then Set MapFrame = Plot.Shapes.Item(i) 'Loops through all of the axes within a map and assigns Arial 10 to labels and titles For j=1 To MapFrame.Axes.Count MapFrame.Axes(j).LabelFont.Face = fontface$ MapFrame.Axes(j).LabelFont.Size = fontsize MapFrame.Axes(j).TitleFont.Face = fontface$ MapFrame.Axes(j).TitleFont.Size = fontsize Debug.Print "Axis "+Str(j)+" done in Map "+Str(i) Next j 'Loops through all of the map layers within a map For k=1 To MapFrame.Overlays.Count 'If the map layer is a contour layer, assign Arial 10 labels If MapFrame.Overlays(k).Type= srfShapeContourMap Then MapFrame.Overlays(k).LabelFont.Face = fontface$ MapFrame.Overlays(k).LabelFont.Size = fontsize Debug.Print "Contour layer done in Map "+Str(i) End If 'If the map layer is a base layer, assign Arial 10 to any text objects in the layer If MapFrame.Overlays(k).Type= srfShapeBaseMap Then MapFrame.Overlays(k).Font.Face = fontface$ MapFrame.Overlays(k).Font.Size = fontsize Debug.Print "Base layer done in Map "+Str(i) End If 'If the object is a graticule, assign Arial 10 labels If MapFrame.Overlays(k).Type = srfShapeGraticule Then MapFrame.Overlays(k).LabelFont.Face = fontface$ MapFrame.Overlays(k).LabelFont.Size = fontsize Debug.Print "Graticule done in Map "+Str(i) End If 'If the map layer is a post layer or a classed post layer, loop through all label sets and assign Arial 10 If MapFrame.Overlays(k).Type= srfShapePostmap Or MapFrame.Overlays(k).Type= srfShapeClassedPost Then MapFrame.Overlays(k).LabelFont.Face = fontface$ MapFrame.Overlays(k).LabelFont.Size = fontsize Debug.Print "Post layer done in Map "+Str(i) End If Next k End If 'If the object is a color scale or legend, assign Arial 10 labels and title If Plot.Shapes.Item(i).Type = srfShapeColorScale Or Plot.Shapes.Item(i).Type = srfShapeLegend Then Plot.Shapes.Item(i).LabelFont.Face = fontface$ Plot.Shapes.Item(i).LabelFont.Size = fontsize Plot.Shapes.Item(i).TitleFont.Face = fontface$ Plot.Shapes.Item(i).TitleFont.Size = fontsize Debug.Print "Color scale/legend done" End If 'If the object is a scale bar, assign Arial 10 to the labels and title If Plot.Shapes.Item(i).Type = srfShapeScale Then Plot.Shapes.Item(i).LabelFont.Face = fontface$ Plot.Shapes.Item(i).LabelFont.Size = fontsize Debug.Print "Scale bar done" End If 'If the object is a profile, change the font to Arial 10 for the profile labels and the title and labels of both axes If Plot.Shapes.Item(i).Type = srfShapeProfile Then Plot.Shapes.Item(i).TitleFont.Face = fontface$ Plot.Shapes.Item(i).TitleFont.Size = fontsize For l=1 To Plot.Shapes.Item(i).Axes.Count Plot.Shapes.Item(i).Axes(l).LabelFont.Face = fontface$ Plot.Shapes.Item(i).Axes(l).LabelFont.Size = fontsize Plot.Shapes.Item(i).Axes(l).TitleFont.Face = fontface$ Plot.Shapes.Item(i).Axes(l).TitleFont.Size = fontsize Next l Debug.Print "Profile layer and axes done End If 'If the object is a drawn text object, assign Arial 10 labels If Plot.Shapes.Item(i).Type = srfShapeText Then Plot.Shapes.Item(i).Font.Face = fontface$ Plot.Shapes.Item(i).Font.Size = fontsize Debug.Print "Text done" End If Next i End Sub