Implement a dictionary key lookup for pulling a given font from Photoshop's font list. Similar to my commit adding a dictionary lookup for ArtLayers and LayerSets, I found a massive execution time boost when using this method (about 193% faster than getByName in my testing). Please note: this methodology does require that you provide the postScriptName of the font which is usually different from the name, searching for the name will raise an error.
Example
# Pulling a font with this method (postScriptName)
font = app.fonts['JaceBeleren-Bold']
# Pulling a font the slow way (name)
font = app.fonts.getByName("Jace Beleren Bold")
Not sure what's causing the import test fail but I see that its failing in a lot of recent PR's so I'm guessing its something that's been here for a bit
Purpose
Implement a dictionary key lookup for pulling a given font from Photoshop's font list. Similar to my commit adding a dictionary lookup for
ArtLayers
andLayerSets
, I found a massive execution time boost when using this method (about 193% faster thangetByName
in my testing). Please note: this methodology does require that you provide thepostScriptName
of the font which is usually different from the name, searching for thename
will raise an error.Example