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

InDesign and working with Msft Word documents using APTOS fonts.

New Here ,
Jun 19, 2024 Jun 19, 2024

Copy link to clipboard

Copied

Our company creates a Quarterly Newsletter for customers. Employees can submit articles and then productions places them into the InDesign Templets created. Since Microsoft introduced the APTOS family of fonts to their Microsoft 365 Office Products, my team spends more time correcting the missing font family because it's in the Cloud and only useable with Msft products. This would be simple if I changed the Msft Word Default Font back to a real font, but we have over 100 employees submitting articles and ideas. 

I need a solution since Microsoft is a partner or team player.

Not a happy camper, something simple is now comples.

TOPICS
How to

Views

217

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 ,
Jun 25, 2024 Jun 25, 2024

Copy link to clipboard

Copied

There's a font substitution script here

 

https://creativepro.com/scripts-for-fixing-missing-fonts-in-indesign/

 

Might speed things up. 

 

@Peter Kahrel 
Had a go at editing this script so it works with APTOS font

I think if @barryh61390810  

// DESCRIPTION: Replace APTOS fonts
// Peter Kahrel (modified for APTOS to Arial substitution)

(function () {
    
    var substitutes;
    var problems = '';

    function remove_doubles (s) {
        s = s.replace(/\r$/, '');
        s = s.split('\r').sort().join('\r');
        s = s.replace(/([^\r]+\r)(\1)+/g, '$1');
        return s;
    }

    function alertUI (title, content) {
        if (content instanceof Array) {
            content = content.join('\r');
        }
        var w = new Window ('dialog', title, undefined, {resizeable: true});
            w.alignChildren = ['fill', 'fill'];
            w.add ('edittext', [0, 0, 300, 300], content, {multiline: true});
        w.onResizing = w.onResize = function () {
            this.layout.resize();
        }
        w.show();
    }

    function scriptPath () {
        try {
            return app.activeScript;
        } catch (e) {
            return File(e.fileName);
        }
    }

    function createTable () {
        var o = {};
        // APTOS to Arial substitution table
        o['APTOS\tRegular'] = 'Arial\tRegular';
        o['APTOS\tBold'] = 'Arial\tBold';
        o['APTOS\tItalic'] = 'Arial\tItalic';
        o['APTOS\tBold Italic'] = 'Arial\tBold Italic';
        return o;
    }

    //--------------------------------------------------------------

    function validateTable () {
        var known = {};
        var list = [];
        for (var i in substitutes) {
            if (app.fonts.item(substitutes[i]).status === FontStatus.NOT_AVAILABLE && !known[substitutes[i]] ) {
                list.push(substitutes[i]);
                known[substitutes[i]] = true;
            }
        }
        if (list.length > 0) {
            alertUI('Unavailable fonts', list);
            return null;
        }
        return 1;
    }

    function stillMissing () {
        var o = {};
        var parts;
        var re = /Regular|Roman/i;
        var f = app.documents[0].fonts.everyItem().getElements();
        for (var i = 0; i < f.length; i++) {
            if (f[i].status !== FontStatus.SUBSTITUTED) {
                continue;
            }
            parts = f[i].name.split('\t');
            if (parts[1] === 'Regular') {
                o[parts[0] + '\t' + 'Roman'] = substitutes[f[i].name];
            } else if (parts[1] === 'Roman') {
                o[parts[0] + '\t' + 'Regular'] = substitutes[f[i].name];
            }
        }
        for (var prop in o) {
            if (o.hasOwnProperty(prop)) {
                return o;
            }
        }
        return null;
    }

    function changeParagraphStyles () {
        var pstyles = app.documents[0].allParagraphStyles;
        for (var i = 1; i < pstyles.length; i++) {
            if (pstyles[i].appliedFont.name in substitutes) {
                try {
                    pstyles[i].appliedFont = substitutes[pstyles[i].appliedFont.name];
                } catch (_) {
                    problems += substitutes[pstyles[i].appliedFont.name] + ' (1)\r';
                }
            }
        }
    }

    function changeCharacterStyles () {
        var name;
        var cstyles = app.documents[0].allCharacterStyles;
        for (var i = 1; i < cstyles.length; i++) {
            name = cstyles[i].appliedFont + '\t' + cstyles[i].fontStyle;
            if (name in substitutes) {
                try {
                    cstyles[i].appliedFont = substitutes[name];
                } catch (_) {
                    problems += substitutes[name] + ' (2)\r';
                }
            }
        }
    }

    function fixEmpties () {
        var props = {
            options: app.findChangeGrepOptions.properties,
            find: app.findGrepPreferences.properties,
            change: app.changeGrepPreferences.properties,
        };

        app.findChangeGrepOptions.properties = {
            includeFootnotes: true,
            includeMasterPages: true,
            includeHiddenLayers: true,
            includeLockedLayersForFind: true,
            includeLockedStoriesForFind: true,
        };

        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.findGrepPreferences.findWhat = '^($|\\Z)';
        app.changeGrepPreferences.changeTo = ' ';
        app.documents[0].changeGrep();

        app.findChangeGrepOptions.properties = props.options;
        app.findGrepPreferences.properties = props.find;
        app.changeGrepPreferences.properties = props.change;
    }

    function localOverrides () {
        var change;
        var ranges = app.documents[0].stories.everyItem().textStyleRanges.everyItem().getElements();
        
        for (var i = ranges.length - 1; i >= 0; i--) {
            change = substitutes[ranges[i].appliedFont.name];
            if (change) {
                ranges[i].appliedFont = change;
            }
        }
    }

    substitutes = createTable();
    var validated = validateTable();
    if (!validated && !confirm('Continue?', true, 'Substitute fonts')) {
        exit();
    }
    changeParagraphStyles();
    changeCharacterStyles();
    app.documents[0].stories.everyItem().recompose();
    fixEmpties();
    localOverrides();
    substitutes = stillMissing();
    if (substitutes) {
        localOverrides();
    }

    if (problems.length > 0) {
        alertUI('Problem fonts', remove_doubles(problems));
    }

}());

 

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 ,
Jun 25, 2024 Jun 25, 2024

Copy link to clipboard

Copied

LATEST

You should be able to map the MS docs to ID styles during Place/Import. The easiest method might be to create an import doc that has a style mapped to every common Word style, starting with Normal, the Headings hierarchy, List Item, etc. Import via the Place function, with that mapping, should rewrite all styles to whatever fonts you select, and then you can touch up and then cut/paste the tidied document into your working templates. You may need to keep addind and tweaking import styles for a while as you discover your fellow employees' artistic range.

 

Delete the imported text and save the import doc for the next round.


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.0 ┊ (Amazon) ┊┋

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