Changing font with extendscript

New Here ,
Sep 15, 2020 Sep 15, 2020

Copy link to clipboard

Copied

Hello.

 

I'm currently making font selector on my panel with extendscript.

 

I made MOGRT subtitle form with text properties,

 

And I've found method below,


var project = app.project;
var projectItem = project.rootItem;
var slideshowSequence = project.activeSequence;
var videoTracks = slideshowSequence.videoTracks;
var selectClip = videoTracks[1].clips[0];
var component = selectClip.getMGTComponent();

 

now all I have to do is using "setValue()" to change font,

 

but I cannot find any properties to change.

 

I've found Json form below in this community,

 

['{'
,'"fonteditinfo":{'
,'"capPropFontEdit":true,'
,'"capPropFontFauxStyleEdit":true,'
,'"capPropFontSizeEdit":false,'
,'"fontEditValue":"MyriadPro-Bold"'
,'"fontFSAllCapsValue":false,'
,'"fontFSBoldValue":false,'
,'"fontFSItalicValue":false,'
,'"fontFSSmallCapsValue":false,'
,'"fontSizeEditValue":200},'
,'"textEditValue":"New Text"'
,'}']

 

But it doesn't work and I remember one of admin said PPro's extendscript doesn't return JSON.

 

So, is there any way to change font with PPro extendscript?

 

P.S.

I hope that Text properties can be separated to each higher properties when I make an MOGRT essential graphics

TOPICS
How to , User interface or workspaces

Views

96

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 Beginner ,
Feb 19, 2022 Feb 19, 2022

Copy link to clipboard

Copied

LATEST

I spent a lot of time changing the font of mogrt.

 

Since there was no official way to change the font, after a lot of brainstorming I came up with some alternatives to changing the font.

 

01. Use After Effects' setFonts method to create a mogrt that lets you change the font via the system font name.

This will allow you to change the font by entering the system font name in the Essential Graphics panel. (Of course, if you want to read and replace system fonts, you'll need to develop an interface to the extension.)

 

After Effects tutorial - Font change expression (Andy Ford video)
https://www.youtube.com/watch?v=H06zKX9EAwk

 

02. Change the mogrt file to zip and unzip it. And read "definition.json", change fontEditValue from fonteditinfo to other system font name, save and recompress and change extension to mogrt.

 

You can change the font only if the above process is implemented with node.js and extendscript. Even this, some system fonts are not read well, so some fonts must be added to the array and manually modified system fonts and family fonts.

 

good luck.

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