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

How to insert a different font in one text frame

New Here ,
Oct 20, 2017 Oct 20, 2017

Hi

I have text frame, I want to insert two information with two different font and font size.

example: My name is YYYY

My name is  - Arial

YYYY - Verdana.

var height = 100;

var f = new File("/Users/test/Desktop/NAME.ai");

var doc = app.open (f)

var text1 = doc.textFrames.pointText( [10,-height+10] );

text1.contents = "My name is YYYY";

Thanks in Advance

TOPICS
Scripting
383
Translate
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
Adobe
Community Expert ,
Oct 20, 2017 Oct 20, 2017
LATEST

Here is a basic solution of apply font to textRange(first text frames first character).

app.activeDocument.textFrames[0].characters[0].textFont = app.textFonts.getByName("Verdana");

It might helps your work.

Translate
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