• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Detect missing font with script

Participant ,
Dec 14, 2022 Dec 14, 2022

Copy link to clipboard

Copied

You can find the name of a font with 

app.fonts.getByName(myLayer.textItem.font).name;

However, if the font is missing it'll throw an error. So we use try/catch

displayDialogs = DialogModes.NO; // OFF

var myLayer = app.activeDocument.activeLayer;
var msg = "";

try
{
var myFont = app.fonts.getByName(myLayer.textItem.font).name;
msg += "my font name: " + myFont;
}
catch(eek)
{
var myFont = undefined;
msg += "my font name: " + myFont;
}
alert(msg);

 

Is there another try/catch method I can use to determine if they are either:

(A) typekit/Adobe fonts

or

(B) fonts that have just been uninstalled?

 

Cheers

 

 

 

 

TOPICS
Actions and scripting , Windows

Views

116

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 14, 2022 Dec 14, 2022

Copy link to clipboard

Copied

InDesign, Photoshop, and Illustrator have Adobe Fonts (previously named Typekit) fully integrated with the desktop software. When you open a file that uses fonts which aren't available on your computer, the missing fonts window will show which of those fonts are included with your Creative Cloud subscription.

More info is here: https://helpx.adobe.com/in/fonts/kb/resolve-missing-fonts.html/Wellcare.com

 

 

Thanks,

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2022 Dec 14, 2022

Copy link to clipboard

Copied

Determine if font is type kit font 

List of missing fonts in Photoshop (.psd images)

 

You already asked a question about TypeKit fonts. In short, it's easy to get a list of installed TypeKit fonts on Windows, but the names of the fonts in the catalog are not always 100% the same as their PostScript names.

Out of the scope of the discussion, I tried to use the Levenshtein algorithm to evaluate the similarity of font names, however a) with a large number of installed fonts it works slowly b) false positives are still possible

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 14, 2022 Dec 14, 2022

Copy link to clipboard

Copied

Same problem. Different question. Different angle, different approach. - if that makes sense 😉

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2022 Dec 14, 2022

Copy link to clipboard

Copied

LATEST

However, the answer remains the same - Photoshop doesn't provide any additional information to separate the system font from the typeKit font. Especially if the font is removed.

 

The only way is to interact with the list of fonts at fonts.adobe.com. You can collect the names of all available fonts manually or write a standalone program that will interact with this site. In any case, this is already beyond the capabilities of scripts.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines