Text and Type
if(underline == true){
underlineColor = app.colors.item("Black");
underlineGapColor = app.swatches.item("None");
underlineGapOverprint = false;
underlineGapTint = 100;
underlineOffset = 3;
underlineOverprint = false;
underlineTint = 100;
underlineType = app.strokeStyles.item("Solid");
underlineWeight = .25
}
verticalScale = 100;
}
Fonts
The fonts collection of an InCopy application object contains all fonts accessible to InCopy. By contrast, the
fonts collection of a document contains only those fonts used in the document. The fonts collection of a
document also contains any missing fonts—fonts used in the document that are not accessible to InCopy.
The following script shows the difference between application fonts and document fonts (for the
complete script, see FontCollections):
//Shows the difference between the fonts collection of the application
//and the fonts collection of a document.
var myApplicationFonts = app.fonts;
var myDocument = app.documents.add();
var myStory = myDocument.stories.item(0);
var myDocumentFonts = myDocument.fonts;
var myFontNames = myApplicationFonts.everyItem().name;
var myDocumentFontNames = myDocument.fonts.everyItem().name;
var myString = "Document Fonts:\r";
for(var myCounter = 0;myCounter<myDocumentFontNames.length; myCounter++){
myString += myDocumentFontNames[myCounter] + "\r";
}
myString += "\rApplication Fonts:\r";
for(var myCounter = 0;myCounter<myFontNames.length; myCounter++){
myString += myFontNames[myCounter] + "\r";
}
myStory.contents = myString;
N
: Font names typically are of the form
OTE
of the font family,
"Adobe Caslon Pro<tab>Semibold Italic"
is a tab character, and
<tab>
familyName<tab>fontStyle
fontStyle
is the name of the font style. For example:
Formatting text 41
familyName
, where
is the name