Printing Type Test/Samples via InDesign?

nana
20.Mar.2008 12.46pm
nana's picture

Hello, I just joined this forum. :) I hope this is the proper place for my post.

I’m wondering if there is a good, efficient and pretty way to print (or export to PDF) font test/sample pages. I basically need two lines of information per font: 1) name of font; 2) a specific line of copy in a given size. My Suitcase Fusion does this, in a dirtier way, using the “Print Sample Pages” feature. I’ve typed out the line of copy in the “preview” box, but it’s just so much clutter, and I’m unable to get rid of things like file location. Plus, it takes up an entire page per font.

I’ve made my own manually in InDesign in the past, but it’s incredibly tedious and there must be a better way.

I appreciate any input! Please let me know if my post needs clarifications, and apologies if this belongs elsewhere.

Thank you!
N



Miguel Sousa
20.Mar.2008 2.20pm
Miguel Sousa's picture

Hi Nana, and welcome to Typophile.

If you know InDesign Scripting, it should be fairly easy to do what you want. Below is a snippet that fills-in a text frame with info about the first 5 fonts available to InDesign. The result for me looks like this:


var myTextFrame = app.documents[0].textFrames[0];
var myInsertPoint = myTextFrame.insertionPoints[-1];

for (x=0; x<5; x++) {
myInsertPoint.appliedFont = 'Myriad Pro';
myInsertPoint.fontStyle = 'Regular';
myInsertPoint.pointSize = 8;
myInsertPoint.contents = app.fonts.item(x).fullName + '\n';
myInsertPoint.appliedFont = app.fonts.item(x);
myInsertPoint.pointSize = 16;
myInsertPoint.contents = 'The quick brown fox\n\n';
}


nana
20.Mar.2008 2.50pm
nana's picture

Oh wow, thank you so much, Miguel! I’ve never used InDesign Scripting, but I did manage to put in your snippet. I’m not sure if I can make the appropriate modifications to make it do what I want (i.e., the fonts I want to display are not in sequence, etc.), but I can see that it *would* be possible.

I really appreciate your response and welcome. Thank you!


Miguel Sousa
21.Mar.2008 1.09am
Miguel Sousa's picture

Getting to specific fonts or font families requires a little more effort. Perhaps the two scripts below are more helpful to you.

The first one makes samples of all the fonts that belong to the family or families provided in a hard-coded array — Minion Pro and Myriad Pro, in this case.

The second one composes samples of all the fonts belonging to the family that is currently selected in the Character palette.

Enjoy!

var myFamilies = new Array('Minion Pro','Myriad Pro');
var myStory = app.documents[0].stories[0];
var myInsertPoint = myStory.insertionPoints[-1];
var fontFamilies = app.fonts.everyItem().fontFamily;
var fontIndexes = new Array();

for (var x in fontFamilies) {
for (var y in myFamilies) {
if (fontFamilies[x] == myFamilies[y]) {
x = parseInt(x);
fontIndexes.push(x);
}}}

for (var z in fontIndexes) {
var x = fontIndexes[z];
myInsertPoint.appliedFont = 'Myriad Pro';
myInsertPoint.fontStyle = 'Regular';
myInsertPoint.pointSize = 8;
myInsertPoint.contents = app.fonts.item(x).fullName + '\n';
myInsertPoint.appliedFont = app.fonts.item(x);
myInsertPoint.pointSize = 16;
myInsertPoint.contents = 'The quick brown fox\n\n';
}

######################

var myStory = app.documents[0].stories[0];
var myInsertPoint = myStory.insertionPoints[-1];
var myFontFamily = myInsertPoint.appliedFont.fontFamily;
var fontFamilies = app.fonts.everyItem().fontFamily;
var fontIndexes = new Array();

for (var x in fontFamilies) {
if (fontFamilies[x] == myFontFamily) {
x = parseInt(x);
fontIndexes.push(x);
}}

for (var z in fontIndexes) {
var x = fontIndexes[z];
myInsertPoint.appliedFont = 'Myriad Pro';
myInsertPoint.fontStyle = 'Regular';
myInsertPoint.pointSize = 8;
myInsertPoint.contents = app.fonts.item(x).fullName + '\n';
myInsertPoint.appliedFont = app.fonts.item(x);
myInsertPoint.pointSize = 16;
myInsertPoint.contents = 'The quick brown fox\n\n';
}


nana
21.Mar.2008 9.46am
nana's picture

Wow!! Thank you so much, Miguel! Both of them will come in so very handy. I can’t believe I haven’t taken advantage of the scripting feature in InDesign; you’ve opened me up to a whole new workflow!

I really appreciate your time. Thank you!!