TextItem.font is currently returned as an inoperable TextFont object.
Solution
Return the raw TextItem.app.font which is a string representing the postScriptName of the TextItem's font. This is the normal behavior according to the Photoshop Javascript Reference. Documentation segment attached below.
Note
To set the font of a TextItem using a font existing in Photoshop, you can find the font by name using the Application.fonts collection and pass its postScriptName to TextItem.font, or provide the postScriptName manually if you know it.
# TextFont from fonts collection
arial_bold = app.fonts.getByName('Arial Bold')
text_layer.textItem.font = arial_bold.postScriptName
# Providing a postScriptName manually
text_layer.textItem.font = 'Arial-Bold'
Problem
TextItem.font
is currently returned as an inoperableTextFont
object.Solution
Return the raw
TextItem.app.font
which is a string representing the postScriptName of the TextItem's font. This is the normal behavior according to the Photoshop Javascript Reference. Documentation segment attached below.Note
To set the font of a TextItem using a font existing in Photoshop, you can find the font by name using the
Application.fonts
collection and pass its postScriptName toTextItem.font
, or provide the postScriptName manually if you know it.Other Changes