Listing all fonts used in a document?

   As I understand it, TextFonts is a collection of all fonts available to Illustraot.  Is there a collection of all fonts used in the open document?  Or would I have to step through every textFrame an create that list myself?

I don't know why and how you write error log, so I only add a single alert after all. "xmpString" and "XMP library" are two different methods, you only need one of then.
#target illustrator
var inputFolder = Folder.selectDialog("Select a folder contains '*.eps' files ");
if (inputFolder) {
    var fileList = inputFolder.getFiles('*.eps'),
        fontsInfo = [];
    loadXMPLibrary();
    for (var i = 0; i < fileList.length; i++) {
        if (fileList[i] instanceof File && fileList[i].hidden == false) {
            fontsInfo.push(getFontsInfo(fileList[i]));
    unloadXMPLibrary();
var Loginfo = new File(inputFolder + '/Font.info.txt');
Loginfo.open('w', 'TEXT', '????');
var info = fontsInfo.join('\n\n');
Loginfo.write(info);
Loginfo.close();
if (/(Open Type|TrueType)/.test(info)) {
    alert('Open Type / TrueType font found, see log file for details!')
function getFontsInfo(file) {
    var arr = ['File: ' + decodeURI (file.name)],
        xmpFile, oXmp, fontNumber, i, path, fontname, fonttype, ns = 'http://ns.adobe.com/xap/1.0/t/pg/';
    xmpFile = new XMPFile(file.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ);
    oXmp = xmpFile.getXMP(); //Returns an XMPMeta object
    fontNumber = oXmp.countArrayItems(ns, 'xmpTPg:Fonts');
    xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
    if (fontNumber) { // if there's at least 1 font, proceed
        for (i = 1; i <= fontNumber; i++) {
            path = XMPUtils.composeArrayItemPath(ns, 'xmpTPg:Fonts', i);
            fontname = oXmp.getStructField(ns, path, XMPConst.TYPE_FONT, 'fontName');
            fonttype = oXmp.getStructField(ns, path, XMPConst.TYPE_FONT, 'fontType');
            arr.push([i, '. ', fontname, '-', fonttype].join(''));
    return arr.join('\n');
function loadXMPLibrary() {
    if (!ExternalObject.AdobeXMPScript) {
        try {
            ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
        } catch (e) {
            alert('Unable to load the AdobeXMPScript library!');
            return false;
    return true;
function unloadXMPLibrary() {
    if (ExternalObject.AdobeXMPScript) {
        try {
            ExternalObject.AdobeXMPScript.unload();
            ExternalObject.AdobeXMPScript = undefined;
        } catch (e) {
            alert('Unable to unload the AdobeXMPScript library!');

Similar Messages

  • List all fonts used in the illustrator document

    Hi All,
    Having searched google I can't seem to find what I am after but am hoping someone here might be able to help me.
    Due to a recent issue with a designer using a font that wasn't part of the brand guidelines for a particular company we would now like to list all fonts that are used in the illustrator file in a media panel on the document when it is sent for both internal and external approval.
    I know that I can go to find font, save the list, open the document and then copy and paste that list in to a text box in Illustrator, however this is quite time consuming and a bit of a faff.
    What I would like to know is:
    1. Does such a plug in exist that will create a text box in illustrator and just list all the fonts automatically, ideally updating whenever fonts are changed?
    2. If not does anyone have a script that I can run that will do the same thing and just drop a list of all fonts currently live in the document in to a text box?
    I will have the same issue when working with Indesign documents to so if anyone one know the answers to the above but all related to indesign that would also be great!
    Thanks everyone!

    I thought about AdjustObjectAIColors, and its a good way to get a bunch of them but I'm not 100% sure if it covers all colours or just those found in paths. If not, this would exclude colours on effects & overlays for symbols, found in kPluginArt (though there is a similar function for plugin art specifically) and I imagine text. Probably a few other types if we look hard enough. Granted, paths are probably 90% of colours :-) I also wondered (sinc I haven't tried it before) how comprehensive that method is -- does it hit all the colours in various effects & styles layered on path? Or does it just hit the standard stroke & fill? I assume not, but I don't know.

  • [JS][CS4]List fonts used in the Document

    Hi to all scripting gurus,
    I have this following script that returns a list of fonts used in the document:
    function fontused(){               var fontscoll = document.fonts;               for(var i = 0; i < fontscoll.length; i++){                       var font = fontscoll[i];                       alert(font.name);                } }
    The above is working OK my problem is that it also list the fonts used in the placed illustrator files (.eps). Is there some kind of parameter or something that i can use so that it only list the fonts used in the text?
    -CharlesD

    Charles
    Doesn't time fly?
    This will give you the idea, if when you find more exceptions add them in a likewise manner.
    The "if" statements check that tables, headers, etc. exists otherwise an error will be throw.
    Enjoy
    Trevor
    P.s. I had planned on updating the script after David highlighted the problem, just didn't get round to it.
    // Script to find fonts in documents which are not just in content pasted from illustrator file
    // By Trevor http://forums.adobe.com/message/4807396#4807396
    var   myFonts="",
            uniqueFonts = {}, n;
    if (app.documents[0].stories.everyItem().textStyleRanges.length > 0) fontsIn (app.documents[0].stories.everyItem().textStyleRanges.everyItem().appliedFont)       
    if (app.documents[0].stories.everyItem().tables.length > 0) fontsIn (app.documents[0].stories.everyItem().tables.everyItem().cells.everyItem().textStyleRanges.everyItem().appliedFont)
    if (app.documents[0].stories.everyItem().footnotes.length > 0) fontsIn (app.documents[0].stories.everyItem().footnotes.everyItem().textStyleRanges.everyItem().appliedFont)
    for (n in uniqueFonts) myFonts+=(uniqueFonts[n])+"\r";
    alert(myFonts)
    function fontsIn (item)
            var l = item.length;
            while (l--) uniqueFonts[item[l].name] = item[l].name;

  • List fonts used in a document, search by font.

    Help! I cannot find a way to list, by name, of the fonts used (past tense) in a document. Like in the document properties: where the word and character count is.
    Example: The author used Arial, Arial Condensed and OCR A in her document. I would like to see a list of three font names. If I have (or don't have) those fonts is outside the scope of this request.
    Simply smashing the styles of a document and then restylng by hand is not working so well for me. Most of the documents used manual formatting instead of styles too!
    Second: I can search and replace text if it had a font applied to it, but I cannot specify the font to search on. ANY font will be match and changed to the 'replace' style. Any solution?
    Thanks!
    John Fields

    Interesting request and a bit of a programing challenge but here is what I have come up with. Try it on some of the documents that you need to deal with and let me know how it does.
    Sub FontsUsed 'Version 1 John Vigor 4/25/06
    'List fonts used in Writer document. Appears to work in normal text,
    'Sections, normal Tables, and Frames. Will currently crash on a Table
    'within a Table.
    oDoc = ThisComponent
    Dim fonts as Integer: Dim aFonts(1)
    oTC = oDoc.Text.createTextCursor
    oTC.goRight(1,true) : CurrentFont = oTC.charFontName
    fonts = fonts + 1 : aFonts(fonts) = CurrentFont
    REM Do "normal" text.
    partEnum = oDoc.Text.createEnumeration
    PartEnumerator(partEnum,CurrentFont,fonts,aFonts())
    REM Do Frames.
    oFrames = oDoc.getTextFrames
    If oFrames.Count > 0 then
    fonts = fonts + 1 : ReDim Preserve aFonts(fonts)
    aFonts(fonts) = "NEW FONTS, IF ANY, FOUND IN FRAMES:"
    For I = 0 to oFrames.Count - 1
      thisFrame = oFrames.getByIndex(I)
      partEnum = thisFrame.createEnumeration
      PartEnumerator(partEnum,CurrentFont,fonts,aFonts())
    Next
    EndIf
    REM Prepare list.
    For I = 1 to fonts
    s = s & aFonts(I) & Chr(10)
    Next
    iAns = MsgBox(s,4,"FONTS FOUND. Create font list document?")
    If iAns = 7 then
      End
    Else
      NewDoc = StarDesktop.loadComponentFromURL("private:factory/swriter"," blank",O,Array())
      oVC = NewDoc.CurrentController.getViewCursor
      oVC.String = s : oVC.collapseToEnd
    EndIf  
    End Sub
    Sub PartEnumerator(partEnum,CurrentFont,fonts,aFonts())
    While partEnum.hasMoreElements
    thisElement = partEnum.nextElement
    If thisElement.supportsService("com.sun.star.text.Paragraph") then
       portionEnum = thisElement.createEnumeration
       PortionEnumerator(portionEnum,CurrentFont,fonts,aFonts())
      ElseIf thisElement. supportsService ("com.sun.star.text.TextTab le") then
       Cols = thisElement.getColumns.Count - 1
       Rows = thisElement.getRows.Count - 1
       For C = 0 to Cols
        For R = 0 to Rows
         thisCell = thisElement.getCellByPosition(C,R)
         cellEnum = thisCell.createEnumeration
         While cellEnum.hasMoreElements
          thisPara = cellEnum.nextElement
          portionEnum = thisPara.createEnumeration
          PortionEnumerator(portionEnum,CurrentFont,fonts,aFonts())
         Wend
        Next
       Next
    EndIf
    Wend
    End Sub
    Sub PortionEnumerator(portionEnum,CurrentFont,fonts,aFonts())
    Dim found as Boolean
    While portionEnum.hasMoreElements
    thisPortion = portionEnum.nextElement
    thisFont = thisPortion.charFontName
    If thisFont <> CurrentFont then
      For I = 1 to fonts
       If aFonts(I) = thisFont then found = true: Exit For
      Next
      If found then
       CurrentFont = thisFont : found = false Else
       fonts = fonts + 1 : ReDim Preserve aFonts(fonts)
       aFonts(fonts) = thisFont : CurrentFont = thisFont
      EndIF
    EndIf
    Wend
    End Sub

  • CS2- How to get the fonts used in a document ?

    Hi,
    Can anyone tell how to find the the fonts used in the document directly without iterating through the text art used in the document.BCOZ if i iterate through each text frame or character my plugin works very slowly.I want to speed up the process of finding & replacing the fonts like wat we do manually in the "Type-> Find Font" menu thru my code.
    Please post ur comments on this .If there is no direct option to find &replace the fonts used in the document ,pls let me know the simplest logic of finding & replacing all occurances of a font in a doc so that my process of doing this should be faster.
    Thanks in advance.
    myRiaz

    As far as I know, there's no way to get a list of fonts in use in a document without iterating over the document and compiling a list by asking every piece of art.
    If you want to trigger 'Type > Find Font' there might be a way to invoke that using Actions (AIActionManager.h). I'm not sure if that would help or not though.
    This probably isn't very helpful depending on what you're doing, but I think this is meant to be handled by using character styles. That way you can change a style and update any related text instantly. Not much help though if you're just trying to write a S&R font plugin.

  • List of Fonts used in PDF through Javascript

    Hi all,
    I need to get the list of fonts used in the PDF and have to change the particular font text to some color across the document using Javascript. As i searched, i didn't get any clue. Using Acrobat Professional 7.0.
    Is there any idea plz. share it.
    Thanks,
    vaasu

    You can use a plug-in.
    PDFlib FontReporter is a free plug-in that creates a report of fonts used in a PDF.

  • Programmatically list the fonts used in a PDF

    Hello.
    I want to make a list of all the fonts used in a PDF. After reading (again) the ISO-32000 standard, I tend to think that the only way is to cycle through the pages and list the fonts used in each one.
    Is there any other (and faster) way to do this?

    Nope - that's the only way.
    And don't forget, that you can NOT just look at the Page's Resource dict.  You need to do a full recursive walk down the content stream finding all graphic objects that themselves have resources.  Oh, and don't forget Annotations!

  • List all ports using SAP

    Hi,
    Please, Someone knows how to list all ports using SAP?
    Thank you.
    Enrique

    Hi,
    please visit
    https://websmp207.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700000208202007E
    Regards
    Bernd

  • List of fonts used

    In iWork06/Pages2, is there a feature for generating a list of all typefaces, fonts, and sizes that have been used in the document? Such a report would be very handy when running a postscript through Distiller to generate press-ready PDF.
    Thank you.
    DW

    Sorry, just realized I was in the wrong forum. Please ignore.

  • Pages report list of fonts used

    I am still using iWork06/Pages2 and not able to find this feature, so:
    In iWork08, is there a feature for generating a list of all typefaces, fonts, and sizes that have been used in the document? Such a report would be very handy when running a postscript through Distiller to generate press-ready PDF.
    Thank you.
    DW

    The function is not there, but it could be done using AppleScript, if someone sits down and writes it.

  • How can I list the fonts used in a Keynote presentation?

    I want to share a Keynote file with a colleague, but I imagine that I've used fonts (typefaces) in my presentation that she does not have.
    How do I list all the fonts I used so that I can share the fonts with her, also?
    Thanks.
    --Larry Anderson   adelarry (at) me (dot) com

    Hello,
    this SQL should help:
    db2 "select schemaname from syscat.schemata"

  • How do you list all VIs used in a sequence

    Is there a way of viewing all the VIs used in a sequence? Is there a script you can run and it outputs the VIs being used?

    Hello Risky,
    There is also a way of viewing all VIs used in a Sequence File, but not in a specific sequence of the sequence file.
    Here is how to proceed:
    - Create a New Workspace File and add a New Project File to the workspace, if you don't have this allready.
    - In the Workspace window select the project and Add the Sequence File to the project. The sequence you added can be viewed under the project in the left pane of the workspace view window.
    - Right-click the sequence file and select the 'Insert Code Module' option from the pop-up menu.
    - A new folder named 'CodeModules' will be added under the sequence file and contains all the VIs and all sequence files which are called from the current sequence file.
    In the specific case where in the sequence file you
    have steps only in one sequence (e.g. MainSequence) this way could be helpful for you.
    Regards,
    Silvius
    Silvius Iancu

  • IPhone doesn't render all fonts embedded on PDF documents

    The PDF reader in the iPhone does not render all fonts. When viewing attachments or PDFs posted on a website some text fields just don't show up, but they do when viewed in Preview or Acrobat Reader.
    I have not seen discussions about this so I just want to make sure that the Software developers at Apple are aware of the problem.
    This is a big issue for my profession (Graphic Design/Advertising).

    I have not seen discussions about this so I just want to make sure that the Software developers at Apple are aware of the problem.
    This isn't the place to make sure of this but this is.
    http://www.apple.com/feedback/iphone.html

  • Character pallet does not list all fonts

    On all previous versions of photoshop, whatever fonts were in the windows/fonts folder were available to use in the character pallet. Now, with CS3, only the system fonts show up. Some of the other fonts are listed separately at the bottom of the list...but by name only. Meaning they are not actually the font style that they claim to be. Is this just happening to me? A bug maybe?

    Umm, what fonts? What version of Windows? What are your region settings? Font ordering and display is affected by it... Apart from that, the behavior seems not normal. Do you have enough user privileges to actually access the font folder? Maybe it's something like that, that prevents Windows from properly building its font cache...
    Mylenium

  • Font used in iOS Document Viewer

    Hi, after doing a few Google searches there seems to be very little on the web of this issue.
    When viewing documents (.doc etc.) is there a way to change the font it is displayed in? I find the Serif font very disorientating on such a small screen and would prefer a simple Sans-Serif. Is this at all possible?
    Thanks

    Tim Krynicki wrote:
    Also, is there a way to install more fonts in iOS Pages?
    No.  But you can ask Apple to add that (clearly desirable) capability via
    http://www.apple.com/feedback

Maybe you are looking for

  • CANNOT UPDATE - IPOD EMPTY! HELP!

    I recentley added some CD's to my Itunes and went to update. It gave me a meesege saying there was too much and it would create a new playlist for the rest and update what it could. I deleted a lot of stuff and deleted the playlist it made for me. No

  • Numbers Files (3.2) Files Reformatted to .iwa format. Is there a way to recover?

    I have a small handful of Numbers files that I recently worked in, saved, and closed correctly (as far as I know) but upon trying to access them again, they are now in a format I'm not able to re-open. The new format is, basically, a file folder with

  • Oracle 11G Searching Issue : Statistics Corruption

    Hi, I guess their is some issue with oracle statistics for Text Indexing. Some times i got an issue regarding Text index searching, query throwing wrong results. and when i fire this command :- execute immediate 'analyze table ' ||' '||tablename ||'

  • Why doesn't iCloud retain hyperlinks or live URL addresses in iCloud contacts?

    Why doesn't iCloud retain hyperlinks or live URL addresses in contacts? Hardware/Software Setup Scenario: PC with Windows 7 and Microsoft Office 7 Pro at home for which all ISP (Cox Communications) e-mail is integrated with Microsoft Outlook 7. New A

  • Why not introduce a "but" condition?

    Hi, why not introduce a "but" condition into the Java language? Here's an example: if(earth.isUnderAttack()){ ���go to 10 }but if(earth.getAttack().getAttacker().equals("alien") && earth.getStatus().equals("nice place")){ ���go to 20 }else{ ���go to