Article View: adobe.scripting.indesign
Article #17318Re: *-? Creation of Font List ?-*
From: Chris Haas
Date: Wed, 18 Jun 2003 15:40
Date: Wed, 18 Jun 2003 15:40
71 lines
3579 bytes
3579 bytes
Do you just want to list the names of the fonts or do you want to see what
they look like as well? Here's a VBScript to do the latter. It will produce
a page with a text box filling from corner to corner. Each line will contain
the font name along with an example of its use. I didn't feel like
calculating flow so you can flow the text box on your own. It shouldn't be
too hard to port this to AS if you need that. Also, for some reason my Arial
font is messed up in ID so I had to check for instances of that. If you run
into "Out of memory" issues, uncomment the If/End if lines but make sure you
quit and restart ID if you do.
[code]
Option Explicit
Dim myIA
Dim myID
Dim myTF
Dim myP
Dim myFonts
Dim Var
Dim myText
Dim myTextArray
Dim fontName
myText = "The quick brown fox jumps over the lazy dog. 1234567890"
Set myIA = CreateObject("InDesign.Application.2.0")
Set myID = myIA.Documents.Add
Set myTF = myID.TextFrames.Add
Set myFonts = myIA.Fonts
ReDim myTextArray(myFonts.Count - 1)
myTF.GeometricBounds = Array("36pt", "36pt", "756pt", "576pt")
For Var = 1 To myFonts.Count
myTextArray(Var - 1) = "[" & Replace(myFonts.Item(Var).Name,
ChrW(9), ChrW(32)) & "]" & myText
Next
myTF.TextContents = Join(myTextArray, Chr(13))
For Var = 1 To myFonts.Count
fontName = myFonts.Item(Var).Name
'Ignore the commented out section below. My Arial font doesn't seem
to work well in ID
'If (fontName <> "Arial" & ChrW(9) & "Regular") And (fontName <>
"Arial" & ChrW(9) & "Italic") And (fontName <> "Arial" & ChrW(9) & "Bold
Italic") And (fontName <> "Arial" & ChrW(9) & "Bold") And (fontName <>
"Arial Black" & ChrW(9) & "Regular") Then
myTF.ParentStory.Paragraphs.Item(Var).AppliedFont =
myFonts.Item(Var)
'End If
Next
[/code]
"Jens Schulze" <shannera@shannera.de> wrote in message
news:85A7AE2C3CECDBA940082F023CAF4DCE@in.WebX.la2eafNXanI...
> "Michael T Kleven" wrote:
>
> > Is there a script or efficient way to make a font list of all fonts
> located
> > in a font folder? {Short of typing and copying text and applying 1000+
> > fonts? Which would take quite a while to do...}This process would be
> > to create a reference book of fonts.
>
> It would be fine if you can provide us with the humble info which
operating
> system the script should be for, unfortunately our group oracle is out of
> office.
> Did you know that the usage of weird characters and patterns in forum
topics
> will decrease the chance of helpfull responses? ;-)
>
> Jens
>
>
Technical Details
Message-ID:
<7092ECF6DA3DB6218DB1B85636A7E336@in.WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de98ea3.-1@WebX.la2eafNXanI> <85A7AE2C3CECDBA940082F023CAF4DCE@in.WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,4146c3faf72435f7 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-06-18 09:08:41 PST From: "Chris Haas" <ChrisH@OvationAdvertising.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: *-? Creation of Font List ?-* Message-ID: <7092ECF6DA3DB6218DB1B85636A7E336@in.WebX.la2eafNXanI> Date: Wed, 18 Jun 2003 08:40:57 -0700 References: <1de98ea3.-1@WebX.la2eafNXanI> <85A7AE2C3CECDBA940082F023CAF4DCE@in.WebX.la2eafNXanI> Lines: 73 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit