Copy link to clipboard
Copied
Hi All,
I am trying to find the "missing font list" from the *.psd file (Photoshop) using the javascript. Please help me to find the missing font list.
Thanks,
Magesh
missing fonts in the stylesheet are marked with fontAvailable == false
#target photoshop
var s2t = stringIDToTypeID,
missingFontList = {};
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('numberOfLayers'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
var len = executeActionGet(r).getInteger(p);
for (var i = 1; i <= len; i++) {
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('textKey'));
r.putIndex(s2t('layer'), i);
if
...
Copy link to clipboard
Copied
I don’t recall a font list in the document properties.
Which, if I’m not mistaken, would mean having to process the Type Layers – I am not sure if missing fonts can be directly recognized or if one would have to compare a list of all fonts with the list of fonts the application has access to.
@r-bin , @Kukurykus , @jazz-y , please forgive the intrusion, but you seem to be some of the most active current posters when it comes to Photoshop Scripting – do you have ideas on this issue? (Or recall an existing Script for the task? )
Copy link to clipboard
Copied
missing fonts in the stylesheet are marked with fontAvailable == false
#target photoshop
var s2t = stringIDToTypeID,
missingFontList = {};
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('numberOfLayers'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
var len = executeActionGet(r).getInteger(p);
for (var i = 1; i <= len; i++) {
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('textKey'));
r.putIndex(s2t('layer'), i);
if (executeActionGet(r).hasKey(p)) {
var sList = executeActionGet(r).getObjectValue(p).getList(s2t('textStyleRange'));
for (var x = 0; x < sList.count; x++) {
var k = sList.getObjectValue(x).getObjectValue(s2t('textStyle'))
if (k.hasKey(s2t('fontAvailable'))) {
if (!k.getBoolean(s2t('fontAvailable'))) {
missingFontList[k.getString(s2t('fontPostScriptName'))] = false
}
}
}
}
}
alert(missingFontList.toSource())
Copy link to clipboard
Copied
Impressive, thanks for checking into this thread!
Copy link to clipboard
Copied
Thanks for your support!!!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now