Fonts

These IronPython scripts below show how to modify any of the Cross Table visualization settings found on the Fonts tab of the Cross Table Properties dialog box in the Spotfire user interface.
Note

In each of the scripts below, it is assumed that the MyVis variable references the targeted visualization. See here for more information about referencing visualizations.

Change Cross Table Fonts Tab Settings:

Changing visualization fonts settings using IronPython requires two steps, as shown in the script below.

  1. Set up the desired font with font name, size, and style options
  2. Apply the font settings to any desired text categories
from Spotfire.Dxp.Application.Visuals import *
from System.Drawing import * 

myVis = myVis.As[Visualization]()

# 1. Set up the desired font:
# Font can be any font name in the "Font:" dropdown menu
# Size can be any integer in the "Size:" dropdown menu
# Style can be bold, italic, both, or neither
# Three possible examples are shown below:

# Arial, Size 20, Not Bold or Italic
font = Font("Arial", 20) 
# OR
# Calibri, Size 12, Bold
font = Font("Calibri", 12, FontStyle.Bold)
# OR
# Forte, Size 8, Bold and Italic
font = Font("Forte", 8, FontStyle.Bold | FontStyle.Italic)



# 2. Apply the font settings to any desired text categories
# (Order below is the same as the fonts tab in the user interface)

# Cross table texts:
myVis.TableFont = font

# Cross table headers:
myVis.TableHeaderFont = font

# Cross table subtotals and grand total
myVis.TableTotalsFont = font

# Legend
myVis.Legend.Font = font

# Column axis title label (printing only)
myVis.ColumnAxis.TitleFont = font

# Row axis title label (printing only)
myVis.RowAxis.TitleFont = font

# Measure axis title label (printing only)
myVis.MeasureAxis.TitleFont = font

# Description:
# Not available in the Spotfire API

# Details visualization message:
myVis.Data.LimitingMarkingsEmptyMessageFont = font
Welcome!

The purpose of this website is to provide a comprehensive, accurate, and efficient IronPython reference for Spotfire developers.