Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
#target indesign
//--------------------------------------------------------
start = 0x0020;
stop = 0x2BFF;
//--------------------------------------------------------
if (app.selection.length == 0 || app.selection[0].constructor.name != 'TextFrame')
exit();
test_frame = app.selection[0];
in_font = [];
for (i = start; i <= stop; i++)
if (char_in_font (test_frame, String.fromCharCode (i)))
in_font.push (pad (i) + ': ' + String.fromCharCode (i));
if (in_font.length > 0)
test_frame.contents = in_font.join ('\r');
function char_in_font (tf, ch)
{
try
{
// insert the character
tf.contents = ch;
// create outline
tf.characters[0].createOutlines();
// if we got here it worked: delete the outline and return 'true'
tf.characters[0].remove();
return true
}
catch(_)
{
// couldn't create outline: delete it, return 'false'
tf.characters[0].remove();
return false
}
}
// Pad hex numbers to a 4-place string
function pad (n)
{
n = '000' + n.toString(16).toUpperCase();
return n.replace (/.+(....)$/, '$1')
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
#target indesign
//---------------------------
typeface = 'Minion Pro';
fontstyle = 'Regular';
start = 0x0041;
stop = 0x005A;
//---------------------------
if (app.fonts.item (typeface+'\t'+fontstyle).status == FontStatus.notAvailable)
{
alert (typeface+'-'+fontstyle + " is not available.");
exit()
}
test_frame = app.documents.add ().textFrames.add ({geometricBounds: ["10mm","10mm","30mm","30mm"]});
in_font = [];
for (i = start; i <= stop; i++)
if (char_in_font (test_frame, String.fromCharCode (i)))
in_font.push (pad (i) + ': ' + String.fromCharCode (i));
if (in_font.length > 0)
test_frame.contents = in_font.join ('\r');
function char_in_font (tf, ch)
{
try
{
// insert the character
tf.contents = ch;
// create outline
tf.characters[0].createOutlines();
// if we got here it worked: delete the outline and return 'true'
tf.characters[0].remove();
return true
}
catch(_)
{
// couldn't create outline: delete it, return 'false'
tf.characters[0].remove();
return false
}
}
// Pad hex numbers to a 4-place string
function pad (n)
{
n = '000' + n.toString(16).toUpperCase();
return n.replace (/.+(....)$/, '$1')
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
//DESCRIPTION: Print a font's available characters
//Peter Kahrel -- www.kahrel.plus.com
#target indesign
//---------------------------
typeface = 'Minion Pro';
fontstyle = 'Regular';
start = 0x0041;
stop = 0x005A;
//---------------------------
if (app.fonts.item (typeface+'\t'+fontstyle).status == FontStatus.notAvailable)
{
alert (typeface+'-'+fontstyle + " is not available.");
exit()
}
test_frame = app.documents.add ().textFrames.add ({geometricBounds: ["10mm","10mm","30mm","30mm"]});
in_font = [];
for (i = start; i <= stop; i++)
{
try
{
if (char_in_font (test_frame, String.fromCharCode (i)))
in_font.push (pad (i) + ': ' + String.fromCharCode (i));
}
catch (_){}
}
if (in_font.length > 0)
test_frame.contents = in_font.join ('\r');
function char_in_font (tf, ch)
{
try
{
// insert the character
tf.contents = ch;
// create outline
tf.characters[0].createOutlines();
// if we got here it worked: delete the outline and return 'true'
tf.characters[0].remove();
return true
}
catch(_)
{
// couldn't create outline: delete it, return 'false'
tf.characters[0].remove();
return false
}
}
// Pad hex numbers to a 4-place string
function pad (n)
{
n = '000' + n.toString(16).toUpperCase();
return n.replace (/.+(....)$/, '$1')
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now