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

Remove ligatures from Document

Community Beginner ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

Hi guys, we have a suite of documents that we're changing a font on. We're changing from Applied Sans to Roboto to avoid licensing costs. Unfortunately, Roboto has ligatures and they're automatically applied to the documents when we change the fonts. These documents range between 14 and 2 pages, and they're text heavy, thus there are many ligatures thoughout. There are also a multitude of paragraph and character styles throughout all the documents and as far as we can see we can only remove all ligatures by going into each style and un-ticking it in multiple positions. We also untick a preference - Preferences - Advanced Type - Show for Character Alternates, Fractions, Ordinals and Ligatures. However, this hasn't solved the problem. This has become a time consuming process and we're looking to streamline it. I've tried multiple scripts but none have worked - I get a Java Script error. Perhaps someone can provide a 2023 script that will do the job? There isn't a work-around to using Roboto, the font choice is set in stone. Any advice on the issue would be much appreciated.

TOPICS
How to , Scripting , Type

Views

1.5K

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 ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

If you have related paragraph styles you could change it with a click in your parent style. If not, you have learned to do it better in the future.

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 ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

There are probably all kinds of overrides in your documents, so the easiest and quickest method is probably to disable ligatures as a global local override (sounds like a contradiction in terms, but you get the picture) with this one-line script:

app.documents[0].stories.everyItem().ligatures = false;

 

 

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 Beginner ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

Hi Peter, thank you for your response. I'm pretty green when it comes to Scripts. So far none of the ones I've created have worked. I place the text in a TextEdit doc, save it to the Scripts Panel folder, then rename it .jsx file. These haven't worked for me including that one line version you sent. Is there something I'm doing wrong?

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 ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

How does it not work? Is the script grayed out? Are you doubleclicking it? 

 

If it's grayed out, the script was probably saved as a RTF. Sometimes TextEdit defaults saved files to RTF. There's a setting somewhere in TE to default to plain text, which is what you want.

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 Beginner ,
Nov 30, 2023 Nov 30, 2023

Copy link to clipboard

Copied

The script shows up on the panel, it just doesn't do anything. No ligatures removed.

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
Participant ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

Hello @defaultr7v002let17e ,

 

Basically what you need is a script that goes through the styles and activates/deactivates the right properties.

.

Can you upload a sample in INDD/IDML with your current styles? If so, open a document and delete the content, leaving a few paragraphs applied, and then we'll be able to help you with your exact scenario.

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 ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

Couldn't you use the Find/Change dialog for this? I guess it depends on how many documents you're working with, but I've done this in the past myself; I'd open a hundred small documents, set up a Find/Change query with "All Documents" selected in the Search: dropdown, then just click "Change All" and walk away from the machine for a few minutes. Make sure you untick both the "Ligatures" checkbox in Basic Character Formats and the "Discretionary Ligatures" in the OpenType Features. 

 

If that doesn't work for you, or if you are dead-set on JS: I went and found the first Google hit for "turn ligatures off in indesign with javascript" which was a thread located here, from 2009. It took me a few minutes to get it to work, but with a few minor changes, it seems to succesfully & silently turn off ligatures in all paragraph styles:

 

// Turn off all ligatures in all paragraph styles
// Originally posted to the Adobe User Forums by Kasyan Servetsky
// featuring Gabe Harbs suggesting "allParagraphStyles" way back in 2009
// and Joel Cherney adding a [i] in 2023


var myDoc = app.activeDocument;
var myParStyles = myDoc.allParagraphStyles;
for (i = 1; i < myParStyles.length; i++) {
    myParStyles[i].ligatures = false;
}

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 ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

Yeah, nevermind; somehow I started writing this post hours ago, and only clicked on "Post" just now, but I think that Peter Kahrel's one-liner upthread is a far better solution. (Unless, of course, your documents are perfectly groomed with zero style overrides, in which case this one is actually what you were asking for.)

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 Beginner ,
Nov 30, 2023 Nov 30, 2023

Copy link to clipboard

Copied

Thank you for your response, unfortunately I get the following error when i use this.

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 ,
Nov 30, 2023 Nov 30, 2023

Copy link to clipboard

Copied

LATEST

As @brian_p_dts mentioned earlier - you've saved your script as RTF - just changing the extension won't work.

 

You need to use Notepad or use your current editor but make sure you are saving as a "plain text" - or ".TXT".

 

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