tasks/google_fontface.js
// urls reference local TTF files.
urls reference local TTF files.
urls reference local TTF files .
function modifySrc(body, file) {
        return body.replace(refontface, (match, family, style, weight, src) =>{
            family = family.replace(/\s/g, '');
            style = style.replace(/^\w/, c => c.toUpperCase());
            weight = weights[weight];
            const altNames = [
                `${family}-${weight}${style}`,
                `${family}-${style}`,
                `${family}-${weight}`,
                `${family}`
            ];
            for (let name of altNames) {
                let fileName = name2file(name, file);
                if (fileName !== null) {
                    return replaceURL(match, path.relative(path.dirname(file.dest), fileName));
                }
            }
            return match;
        });
    }
function modifySrc ( body , file ) { return body . replace ( refontface , ( match , family , style , weight , src ) => { family = family . replace ( / \s / g , '' ) ; style = style . replace ( / ^\w / , c => c . toUpperCase ( ) ) ; weight = weights [ weight ] ; const altNames = [ ` ${ family } ${ weight } ${ style } ` , ` ${ family } ${ style } ` , ` ${ family } ${ weight } ` , ` ${ family } ` ] ; for ( let name of altNames ) { let fileName = name2file ( name , file ) ; if ( fileName !== null ) { return replaceURL ( match , path . relative ( path . dirname ( file . dest ) , fileName ) ) ; } } return match ; } ) ; }
urls reference local TTF files.
urls reference local TTF files .