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?
Copy link to clipboard
Copied
Well.. that didn't quite get the response I was hoping for. #wasitsomethingIsaid
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'));
}
}
* 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
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?
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.
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.
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
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).
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now