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

Determine if font is type kit font

Engaged ,
Nov 03, 2022 Nov 03, 2022

Copy link to clipboard

Copied

I can determine the number of fonts I have with:

 

var numOfFonts = app.fonts.length;

 

Yay! I have three fonts installed!

 

But I now need a way to determine if that font belong to typekit or not. - This process can be done manually but I'm keen to script this. However, I don't think there are any properties for this in TextItem.

Can it be done with scripting?

 

TOPICS
Actions and scripting , Windows

Views

441

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
Adobe
Engaged ,
Nov 09, 2022 Nov 09, 2022

Copy link to clipboard

Copied

Well.. that didn't quite get the response I was hoping for. #wasitsomethingIsaid

Votes

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
Guide ,
Nov 09, 2022 Nov 09, 2022

Copy link to clipboard

Copied

Photoshop does not provide any additional attributes for typekit fonts.

 

In Windows* you can find a list of such fonts by reading the entitlements.xml file located at:

%userprofile%\AppData\Roaming\Adobe\CoreSync\plugins\livetype\c\

 

This XML file have enough attributes to match them with the list of fonts that Photoshop provides:

 

<font> <url>https://api.typekit.com/desktop_v2/sync/F030623B4FAC08CA0A490D44%40AdobeID/TkD-48850-f80dffe04cf3ca5b0e91778f3f76c5c2e76bb9c1</url>
      <id>48850</id>
      <properties>
        <fullName>BD Supper Regular</fullName>
        <familyName>BD Supper</familyName>
        <variationName>Regular</variationName>
        <familyURL>https://typekit.com/fonts/bd-supper</familyURL>
        <sortOrder>800</sortOrder>
        <owner>Adobe Fonts</owner>
        <installState>OS</installState>
        <installStateUpdatedAt type="dateTime">2022-11-09T10:17:13Z</installStateUpdatedAt>
        <syncFontId>TkD-48850-f80dffe04cf3ca5b0e91778f3f76c5c2e76bb9c1</syncFontId>
        <familyWebId>wbqb</familyWebId>
        <fvd>n4</fvd>
        <isVariable>false</isVariable>
      </properties>
</font>

 

We can work with this file** like this:

 

var f = new File(Folder.userData + '/Adobe/CoreSync/plugins/livetype/c/entitlements.xml');
if (f.exists) {
    f.open('r')
    var xmlStr = f.read();
    f.close();
    if (xmlStr.length) {
        var contentXML = new XML(xmlStr),
            typeKitFonts = new XML(contentXML.fonts),
            i = 0, s = [];
        while (typeKitFonts.font[i]) s.push(typeKitFonts.font[i++].properties.fullName);
        alert(s.join('\n'));
    }
}

 

2022-11-09_13-14-09.png

macOS uses a different livetype storage system and this trick won't work.

** you can find more information about working with XML in JAVASCRIPT TOOLS GUIDE

Votes

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 ,
Nov 09, 2022 Nov 09, 2022

Copy link to clipboard

Copied

Just to make sure: Are you trying to verify for all installed fonts or only the fonts used in a specific document? 

Votes

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
Engaged ,
Nov 09, 2022 Nov 09, 2022

Copy link to clipboard

Copied

Niether, I'm trrying to keep track of what typekit fonts I'm currently using. Sometimes the typekits fonts time out - possible from not using them for x days or Creative Cloud is on the blink again. 

 

One idea I had, as I'm experiencing Creative Cloud issues,  is to keep an array of typekits fonts currently installed. Run a script that automatically creates a document with a string of text of all of those type kit fonts. Repeat on a daily basis so you don't "accidentally" lose access to them. - Just an idea...

 

I've already written a script to find fonts used in a specific document. 

Votes

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
Guide ,
Nov 09, 2022 Nov 09, 2022

Copy link to clipboard

Copied

I didn't go into too much detail, but typekit fonts are not installed into the operating system. They are stored in the Adobe plugin folder, and, as far as I understand, the files are encrypted (at least when looking at them I did not see data typical for the font files).

 

By the way, I have never noticed problems with the disappearance of once installed typekit fonts.

Votes

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
Engaged ,
Nov 09, 2022 Nov 09, 2022

Copy link to clipboard

Copied

They don't "dissapear" as such - just default to Myriad Pro or something similar.

The script worked a treat 🙂

 

Also, for my future self:

.properties.postscriptName //Post script font names

 

Votes

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
Guide ,
Nov 09, 2022 Nov 09, 2022

Copy link to clipboard

Copied

I have seen font replacement with Myriad Pro, in most cases this happens with self-installed fonts in the case when the text contains characters that are not in the font table.

 

I don't see the postscript names in the xml file and this can present a problem when trying to match the font names provided in Photoshop. I assume that the naming system is standardized and in 99% of cases the PostScript name (without separators) is equal to familyName + variationName (also without separators).

Votes

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
LEGEND ,
Nov 09, 2022 Nov 09, 2022

Copy link to clipboard

Copied

LATEST

Downloaded TypeKit font files didn't used to be encrypted, but I don't think we can discuss how to turn them back into regular OpenType files.

CC App has a built-in timer where activated fonts are deactivated after an amount of time idle. This would only be a problem if the computer was offline and couldn't connect to reactivate the fonts.

Votes

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