Copy link to clipboard
Copied
What I'm trying to achieve, is a possibility to set the font for some paragraph style even despite the fact the font is not available on the system.
I'm trying to figure out is this somehow possible via ExtendScript? I've tried different ways but the font is either not being set or it throws an Error like ''The requested font family is not available."
Is it actually possible to set the font via ExtendScript, despite the fact it is missing currently?
I need that to trigger the missing font's dialog afterwards and suggest user to locate that missing font. But even if user won't provide it - the updated paragraph style needs to be saved with the missing font name, so probably on other PC where the font will be available, it will be possible to provide that font via 'Missing Fonts' dialog?
Copy link to clipboard
Copied
After some additional googling and research I came onto this: Re: How to specify appliedFont and fontStyle to a paragraph style without the font being loaded.
So it looks like there is a theoretical way to do it via snippets exporting/importing. Probably someone has a working code snippet/script that does that or any part of the solution? I would be glad to take a look at it.
Or probably someone still knows another way to achieve the requested?
Thanks to everybody in advance,
Copy link to clipboard
Copied
I solved this by saving a previously created style inside an InDesign library:
Now you have the library snippet (or text frame) that contains the styled text you can place (and remove again) in any document to add the containing styles to the new document. (Note that it won't override an existing style with the same name, but you could force this by removing it first)
var myLib = app.open( File( myLibPath ), false );
var myAsset = myLib.assets.item( myAssetName );
var myTextFrame = myAsset.placeAsset( myDoc );
myTextFrame.remove(); // Leaves styles behind