How to use "remapFonts" in action manager?
I am working on tool which can remap desired fonts including typefaces even if single layer has multiple fonts and typefaces. Because seems to that Adobe is unable to do it.
My question is. Can I remap any font? Or does this work only with broken fonts? I tried it a and it behaves strange.
It replaces font which I didn't specified but they are broken. So I think this maybe works only for broken fonts.
var idremapFonts = stringIDToTypeID( "remapFonts" );
var desc415 = new ActionDescriptor();
var idfontMap = stringIDToTypeID( "fontMap" );
var list43 = new ActionList();
var desc416 = new ActionDescriptor(); // one pair
var idfromFont = stringIDToTypeID( "fromFont" );
var desc417 = new ActionDescriptor();
var idFntN = charIDToTypeID( "FntN" );
desc417.putString( idFntN, """Lato""" );
var idFntS = charIDToTypeID( "FntS" );
desc417.putString( idFntS, """Regular""" );
var idfontSpec = stringIDToTypeID( "fontSpec" );
desc416.putObject( idfromFont, idfontSpec, desc417 );
var idtoFont = stringIDToTypeID( "toFont" );
var desc418 = new ActionDescriptor();
var idFntN = charIDToTypeID( "FntN" );
desc418.putString( idFntN, """Comic Sans MS""" );
var idFntS = charIDToTypeID( "FntS" );
desc418.putString( idFntS, """Regular""" );
var idfontSpec = stringIDToTypeID( "fontSpec" );
desc416.putObject( idtoFont, idfontSpec, desc418 );
var desc416b = new ActionDescriptor(); // second pair
var idfromFont = stringIDToTypeID( "fromFont" );
var desc417b = new ActionDescriptor();
var idFntN = charIDToTypeID( "FntN" );
desc417b.putString( idFntN, """Lato""" );
var idFntS = charIDToTypeID( "FntS" );
desc417b.putString( idFntS, """Bold""" );
var idfontSpec = stringIDToTypeID( "fontSpec" );
desc416b.putObject( idfromFont, idfontSpec, desc417b );
var idtoFont = stringIDToTypeID( "toFont" );
var desc418b = new ActionDescriptor();
var idFntN = charIDToTypeID( "FntN" );
desc418b.putString( idFntN, """Comic Sans MS""" );
var idFntS = charIDToTypeID( "FntS" );
desc418b.putString( idFntS, """Bold""" );
var idfontSpec = stringIDToTypeID( "fontSpec" );
desc416b.putObject( idtoFont, idfontSpec, desc418b );
var idfontRemapEntry = stringIDToTypeID( "fontRemapEntry" );
list43.putObject( idfontRemapEntry, desc416 ); // adding first pair to list
list43.putObject( idfontRemapEntry, desc416b ); // adding second pair to list
desc415.putList( idfontMap, list43 );
executeAction( idremapFonts, desc415, DialogModes.NO );