Hello I was wondering if someone knows how to customize the title font using ArcPy. This is my current code which was given on ArcPy Documentation under TextElement:
txtStyleItem = p.listStyleItems('ArcGIS 2D', 'TEXT', 'Title (Serif)')[0]
ptTxt = p.createTextElement(lyt, arcpy.Point(11, 10), 'POINT', title_text, 6, style_item=txtStyleItem)
ptTxt.setAnchor('Center_Point')
ptTxt.elementPositionX = 8.5
ptTxt.elementPositionY = 10
ptTxt.textSize = 28
The issue is when I try to change 'Serif' to something else like 'Tahoma' I get an error:
In [10]:
Line 48: txtStyleItem = p.listStyleItems('ArcGIS 2D', 'TEXT', 'Title (Tahoma)' )[0]
IndexError: list index out of range
Does anyone know how to use ArcPy to change the font?