🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #10291

[CS2 JS] Error String: The requested font family is not available.

#10291
From: Skempy
Date: Fri, 30 Jun 2006 08:20
39 lines
2057 bytes
Error when applying Font to selected paragraph

Skempy - 08:08am Jun 27, 2006 Pacific

This line in my script...

myParagraph.appliedFont = app.fonts.item("Helvetica (T1)");

Gives me the error message:

Error number: 15875
Error String: The requested font family is not available.
Line: 13
Source: myParagraph.appliedFont = app.fonts.item("Helvetica (T1)");

I definately have the font Helvetica (T1) in my font list, I have tried with several other fonts, some work and some don't. I am guessing that the font name listed is not the same as the font 'family', am I right? If so, how do I find the font family name. Or is there a better way to apply a font to a paragraph?

The script in full is...

var myDocument = app.activeDocument
ViewPreference.rulerOrigin = RulerOrigin.pageOrigin;
myDocument.zeroPoint = [0,0];
with(myDocument){
var myPage = myDocument.pages.item(0);
with (myDocument.documentPreferences){
var myPageHeight = pageHeight;
var myPageWidth = pageWidth;}
var myTextFrame = textFrames.add();
myTextFrame.geometricBounds = [ myPageHeight-2.5, myPageWidth-6.5, myPageHeight-1, myPageWidth-1];
myTextFrame.contents = "�NPG"
var myParagraph = myTextFrame.paragraphs.item(0);
myParagraph.appliedFont = app.fonts.item("Helvetica (T1)");
myParagraph.fontStyle = "Medium";
myParagraph.pointSize = 5;
myParagraph.justification = Justification.rightAlign;
}

Thanks in advance.
Simon Kemp
Technical Details
Message-ID: <3bc0c543.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.germany.com!news.datemas.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,9ca413236293e333,start
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII
From: Skempy@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: [CS2 JS] Error String: The requested font family is not available.
Message-ID: <3bc0c543.-1@webcrossing.la2eafNXanI>
Date: Fri, 30 Jun 2006 01:20:13 -0700
Lines: 44
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.germany.com!news.datemas.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing