Skip to main content
January 25, 2017
Answered

Universal font change in all documents?

  • January 25, 2017
  • 6 replies
  • 7883 views

Hi,

We've recently changed the fonts we use for all of our company collateral. We are changing from an old, outdated TT file set of Helvetica Neue to the current OT family that Linotype offers. Same face, different font files.

Every * little * thing * we publish uses these fonts and now I have the problem of updating tens of thousands of native files with the new font links. Is there a way universally update in InDesign and Illustrator so that my native files using font set A automatically update to font set B? I don't want to loose hours of my life clicking around in individual files to relink everything.

I've done some poking around and not found any answers to this question. Any help or redirect would be appreciated.

Thanks,

AR

[Changed from Discussion to Question by moderator]

This topic has been closed for replies.
Correct answer Kasyan Servetsky

I've made a new version. Now the user can prepare a list of the fonts to be changed, say in Excel (optionally), and save it as CSV-file which will be used by the script, or you can edit it directly in the CSV-file using a plain text editor like Notepad (PC) or TextEdit (Mac).

— Kas

6 replies

Kasyan Servetsky
Kasyan ServetskyCorrect answer
Brainiac
February 1, 2017

I've made a new version. Now the user can prepare a list of the fonts to be changed, say in Excel (optionally), and save it as CSV-file which will be used by the script, or you can edit it directly in the CSV-file using a plain text editor like Notepad (PC) or TextEdit (Mac).

— Kas

Known Participant
January 26, 2018

Hi Kasyan Servetsky

Thanks for a great script!

But i have a question: I have a font called Gotham (T1) Regular.

Written like this on the csv-file:

Gotham (T1)\tMedium    Helvetica\tRegular

But the font is not recognised by the script, and not beeing replaced.

Should i write it in another way or do you have any idea?

Thanks in advance and have a nice weekend! Best regards, Fred

Kasyan Servetsky
Brainiac
January 26, 2018

Hi Fred,

I guess you have two fonts on your system whose name is Gotham: indicated by (T1) and (TT). This means Type 1 (PostScript) and TrueType  font.

Try to uninstall one of them and use the following line:

Gotham\tMedium    Helvetica\tRegular

— Kasyan

Dov Isaacs
Brainiac
January 30, 2017

You are making a terrible assumption here, that the “old, outdated TT file set of Helvetica Neue” that you currently have installed and are using is really the exact same font as “the current OT family that Linotype offers.”

Ignoring all the wonderful advise offered by other contributors to this thread, you should be aware that just because the name Helvetica Neue is the same, you cannot assume that the font metrics and the encodings are the same.

Differences in metrics including set widths of particular characters and pair kerning tables may very well lead to different line and page breaks.

Differences in encodings between the old and new fonts may result in the wrong characters and/or the .notdef glyph (the box with the X in it) displaying and printing after you actually do the substitution.

You will need to go through your documents and look for these possible discrepancies!

          - Dov

- Dov Isaacs, former Adobe Principal Scientist (April 30, 1990 - May 30, 2021)
Kasyan Servetsky
Brainiac
January 29, 2017

It looks like a very interesting idea for making a script.

I wrote a quick & dirty script for changing fonts which should be used together with my new Batch processor.

Here I posted the script and before and after sample documents (ver. CC 2017).

In the future I'm going to make a more user friendly version so the user could prepare a list of the fonts to be changed, say in Excel (optionally), and save it as CSV-file which will be used by the script. But so far you have to make minor edits to the script:

At the very beginning you'll see the first variable which is the array of arrays containing the names of the fonts in the format

[ "Find this", "Change to this" ],

Here I used the fonts installed with InDesign to make sure that everybody have them and can test the script using my sample.

The left element is 'Find this', the right one is 'Change to'.

The family name and font style should be separated by a tab: either \t or by actual tab (by hitting tab on the keyboard)

The find-change pairs (the elements of array) are separated by commas so make sure that you won't leave a comma after the last element (see the screenshot above).

Then you can select the script in the Batch processor like so:

The 'change fonts' script does the following:

  1. changes the fonts in all the paragraph styles
  2. changes the fonts in all the character styles
  3. changes the fonts applied as a local formatting in the same way as the 'find this font and change to that font' feature works in the Find-Change Text dialog box. Note: to illustrate this point, the first paragraph in my sample is set to Letter Gothic Std  and Minion Pro - Bold, Italic and Bold Italic.

The script changes Minion Pro - Bold, Italic and Bold Italic to Myriad Pro (Letter Gothic Std obviously is left unchanged).

Before

After

Here's the script:

var fontList = [

    ["Minion Pro\tRegular", "Myriad Pro\tRegular"],

    ["Minion Pro\tBold", "Myriad Pro\tBold"],

    ["Minion Pro\tItalic", "Myriad Pro\tItalic"],

    ["Minion Pro\tBold Italic", "Myriad Pro\tBold Italic"]

];

   

main();

function main() {

    try { // if something goes wrong in the try-catch block, the batch processor won't stop here. It will log the error message and continue further

       

        var newFont, paragraphStyle, characterStyle,

        doc = app.activeDocument, // The frontmost document

        paragraphStyles = doc.allParagraphStyles,

        characterStyles = doc.allCharacterStyles;

       

        // Change in paragraph styles

        for (var p = 1; p < paragraphStyles.length; p++) {

            paragraphStyle = paragraphStyles

;

            newFont = getNewFont(paragraphStyle.appliedFont.name);

            if (newFont != null) {

                paragraphStyle.appliedFont = newFont;

            }

        }

        // Change in character styles

        for (var c = 1; c < characterStyles.length; c++) {

            characterStyle = characterStyles;

            newFont = getNewFont(characterStyles.appliedFont + "\t" + characterStyles.fontStyle);

            if (newFont != null) {

                characterStyles.appliedFont = newFont;

            }

        }

       

        for (var i = 0; i < fontList.length; i++) {

            var changed;

            app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;

            app.findTextPreferences.appliedFont = fontList[0];

            app.changeTextPreferences.appliedFont = fontList[1];

            changed = doc.changeText();

            app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;

        }

    }

    catch(err) { // if an error occurs, catch it and write the  document's name, error message and line# where it happened into the log

        gErrorLog.push(doc.name + " - " + err.message + ", line: " + err.line);

    }

}

function getNewFont(oldFontName) {

    var newFont = null;

   

    for (var p = 0; p < fontList.length; p++) {

        if (oldFontName == fontList

[0]) {

            newFont = app.fonts.itemByName(fontList

[1]);

            if (!newFont.isValid) {

                newFont = null;

            }

            break;

        }

    }

    return newFont;

}

Hope this helps.

— Kasyan

Community Expert
January 29, 2017

Hi Kasyan,

thank you for posting this.

Maybe you could use the arrays allParagraphStyles and allCharacterStyles to include cases where the styles are stored in groups.

Thanks,
Uwe

Kasyan Servetsky
Brainiac
January 29, 2017

Hi Uwe,

I do use them in the script.

Regards,
Kasyan

rob day
Community Expert
January 26, 2017

For InDesign documents you can use Type>Find Font... (not Find/Change) which lets you change a document's fonts with the option of updating any styles that use the font with one click. It is certainly scriptable and one likely exists, so ask in the scripting forums.

Willi Adelberger
Community Expert
January 26, 2017

I hope you work with a logical build up Paragraph and Character styles with the very same name in every document. Import these styles from a clean source document and overwrite the existing styles. Otherwise, you have to do the hard work, document by document with find and replace font, and replace them.

Szalam
Community Expert
January 26, 2017

I've moved this thread from the (fairly quiet) Type & Typography​ since this isn't really a question about type, but more of a question about how to use Adobe software. Thus it is now in a product-specific support forum. I would recommend you create a post in the Illustrator​ forum as well since the answer is likely to be different for each software.

That being said, perhaps this would be a question for Illustrator Scripting​ or InDesign Scripting​, but I'm not familiar enough with either of them to know for sure.