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

I`m trying to change font by scripting, but not all font working

Community Beginner ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

this is my script blow:

var textItemRef = app.activeDocument.activeLayer.textItem;

var fonts = app.fonts;

for(var i  = 0; i < fonts.length; i++){

var fontName = fonts[i].postScriptName;

textItemRef.font = fontName;

}

i`m trying to set every font installed, but some font(most of them) are set failed(without any changing),is any script i wrote wrong,thanks for any help!

TOPICS
Actions and scripting , Windows

Views

281

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

correct answers 1 Correct answer

Community Beginner , Aug 23, 2020 Aug 23, 2020

thanks for your replay,  i find out what the problem is, if textItem contens is not support the font i trying to set, then the action will be fail!

Votes

Translate

Translate
Adobe
Community Expert ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

Without actually testing this, most fonts are no longer postscript. Does just using font(i).name work?

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 ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

thanks for your replay,  i find out what the problem is, if textItem contens is not support the font i trying to set, then the action will be fail!

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 ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

Hi,

I tried your script, each and every fonts work. May be some of the fonts are different from you. Could you please let us know some of fonts name which are not working at your end?

Best regards

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 ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

LATEST

i fixed the problem, my textItem contens not support some font, so the action failed

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