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

strange behavior for font.name, anyone knows why or what to do?

Community Beginner ,
May 13, 2015 May 13, 2015

Copy link to clipboard

Copied

I recently noted one of our scripts has stopped working in versions above InDesign CS5. It is a script that replaces fonts, using their font.name property. When putting the font name property into an alert box, we see something strange: the font name seems to contain two instances of the fontStyle.

So for instance, if I have a document with two Frutiger fonts, one bold and one light, and the first font in the document font list is "Frutiger 45 Light", and I then show it's name in an alert with the command

alert(app.activeDocument.fonts[0].name);

instead of:

"Frutiger     45 Light"

I get:

"Frutiger     45Light45Light"

Even stranger: when I try

alert(app.activeDocument.fonts.everyItem().name);

I get

"Frutiger     45 Light, Frutiger     65 Bold"

No extra fontStyle here.

Does someone here know what is going on? Are you getting the same results?

I have some memory of the script working on CS6 and CC about half a year ago, but I may of course be wrong. We don't use the script very often, but when we do use it we really need it!

If you want to know, the reason we use font.name instead of font.fullName or font.fontFamily is that the "name" property works with both installed and uninstalled (missing) fonts.

With kind regards

/Mats

TOPICS
Scripting

Views

212

Likes

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 ,
Dec 23, 2022 Dec 23, 2022

Copy link to clipboard

Copied

LATEST

Hi @zixdesign_atwork, sorry nobody answered your question. For anyone else who comes here, please see my answer here. Does seem to be a bug in Indesign.

- Mark

Likes

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