Quantcast
Channel: Adobe Community: Message List - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 3715

Need some support with syntax from FDK to ExtendScript : Getting FontFamily

$
0
0

Hi there, I am using some scripts to traverse my text and add tags to specific characters when they use a given font. This works fine if the PlatformName is known, but every now and a while these seem to be not set. I therefore want to do the following : If no FontPlatformName get the FontFamily instead, but I'm struggling to get it working as the scripting references are a bit limited on covering conversion.

 

This is what's in the fdk (simplified for my needs) :

 

families = F_ApiGetStrings(0, FV_SessionId, FP_FontFamilyNames);

 

for (i=0; i < families.len; i++)

if(F_StrIEqual(families.val[i], "myFont")

     /* Do something*/

) break;

 

But I can't get it working on extendscript

 

What I have now is something like below :

 

var doc = app.ActiveDoc;

var families = Constants.FP_FontFamilyNames.GetStrings;

 

for (var i = 0; i < families.length; i += 1)

{

// alert fontname of families.val[i]

}

 

 

But I'm doing something wrong as it fails on my for loop. Anybody that can help getting the syntax correct ?

 

Thanks in advance already


Viewing all articles
Browse latest Browse all 3715

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>