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

Is it possible to set missing font to paragraph style using font family name in ES?

New Here ,
Sep 18, 2017 Sep 18, 2017

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?

TOPICS
Scripting

Views

272

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
New Here ,
Sep 18, 2017 Sep 18, 2017

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,

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
Explorer ,
Sep 20, 2017 Sep 20, 2017

Copy link to clipboard

Copied

LATEST

I solved this by saving a previously created style inside an InDesign library:

  1. Create a paragraph style when the font is loaded
  2. Create a text frame with placeholder text and apply your newly created style
  3. Put the text frame inside an InDesign library
  4. Unload the font and close the temp doc

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

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