Skip to content

Instantly share code, notes, and snippets.

@lamchau
Created November 15, 2013 10:34
Show Gist options
  • Save lamchau/7482351 to your computer and use it in GitHub Desktop.
Save lamchau/7482351 to your computer and use it in GitHub Desktop.
List all fonts for Photoshop
function PostScriptNameRenderer(element) {
return element ? element.postScriptName : undefined;
}
function getFont(renderer) {
var list = app.fonts;
var result = [];
var name;
var i;
if (renderer) {
for (i = 0; i < list.length; i++) {
name = renderer(list[i]);
result.push(name);
}
}
return result;
}
var result = getFont(PostScriptNameRenderer);
for (var i = 0; i < result.length; i++) {
$.writeln(result[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment