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

Similar Messages

  • [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;

  • 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.

  • 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!');

  • [AS] List of used colors in document

    AppleScript question
    Is there a way to get a list of colors used in a document?

    This oughtta do it...
    tell application "Adobe InDesign CS3"
    tell document 1
    get every color
    get name of every color
    get color value of every color
    get space of every color
    end tell
    end tell

  • How to set price list to use in a Document

    Hi all,
    I have a simple question. I'm trying to insert a draft document into SAP B1 via DI API. I can't seem to find the correct property to set in order to change the price list to use for that draft.
    Example: The price list in the Supplier BP is 'Price List 01' and I want to change it only for the current document to 'Price List 02'.
    Can you guys help me?
    Thanks.
    Edited by: Pedro Magueija on Aug 28, 2009 6:11 PM
    Edited by: Pedro Magueija on Aug 28, 2009 6:41 PM

    That's too bad, since it is possible to do it in SAP B1.
    OK, but since I can only change the price for the item, line by line is it possible to force a .UnitPrice = 0 and .PriceAfterVAT = 100.00?
    The reason I ask is, the document I'm trying to insert get's it's prices from a source where only VAT included prices are present. So instead of the unit price, I want to set the price after VAT and have SAP B1 calculate the unit price.
    I set the BP default price list to a list where no prices are defined, and it works. But has you can imagine, when doing a document in SAP B1 this will cause it to set the prices to 0 on the lines, and the users might get angry at it.
    So if you guys have any ideas on how to go around this some other way, please do tell.
    Thanks in advance.

  • 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

  • Embed fonts using the Edit Document Text tool

    This question was posted in response to the following article: http://help.adobe.com/en_US/acrobat/pro/using/WS58a04a822e3e50102bd615109794195ff-7c75.w.h tml

    Thanks Steve.  I guess it shouldn't be a problem then.  Both of the documents would have been created by aperture and therefore be of the same resolution to start with.
    One more question if I might:  I'm test-driving Acrobat Pro (don't know much about it yet).  I've been using Acrobat standard for simple things like adding/replacing pages.  Would Acrobat standard save at the same quality of the original document or is there some loss of quality there versus using Acrobat Pro?
    Thanks again,
    Michael

  • While editing a scanned pdf, Acrobat will not recognize the current font & change to very different font. How can I choose the font I want to match the current document?

    While editing a scanned pdf, Acrobat will not recognize the current font & change to very different font. How can I choose the font I want to match the current document?

     Thanks for answering. The version is XI.0.10. I just did the update yesterday hoping that I could now properly edit a scanned pdf document. Yes, it's happening on most all scanned documents. I followed your steps & found the list of fonts used in the document & then attempted to edit. The same occurs. When I type in a correction, I get an error alert... "the original font (in this case Fd 5805) is not available or can't be used in editing. Acrobat is using the font Minion Pro in its place." 
    When I select the text & right click as you suggested, my only choices are cut, copy, delete or select all, no "edit text".
    I have no other options to choose another font. Thanks for any help you can direct my way. 
    Debbie
          From: sukritd15 <[email protected]>
    To: Deborah Karr <[email protected]>
    Sent: Friday, February 13, 2015 5:35 AM
    Subject:  While editing a scanned pdf, Acrobat will not recognize the current font & change to very different font. How can I choose the font I want to match the current document?
    While editing a scanned pdf, Acrobat will not recognize the current font & change to very different font. How can I choose the font I want to match the current document?
    created by sukritd15 in Creating, Editing & Exporting PDFs - View the full discussionHi Deborah , I would like to know couple of things before I assist you further.1.Which version of Acrobat are you using ?2.Is it happening for all the scanned PDF' or any particular PDF? You can try these steps,Launch the scanned PDF >right click >Document Properties(from the drop down list) >Fonts(on the dialog box)>From here you will get the fonts used in that PDF . While editing the PDF ,select the text that are editing or typing in with the help of selection tool .After you select the text ,right click on the text and choose "edit text" from the drop down list .From there you will be able to choose the desired font . RegardsSukrit Dhingra If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7190881#7190881 and clicking ‘Correct’ below the answer Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7190881#7190881 To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"  Start a new discussion in Creating, Editing & Exporting PDFs by email or at Adobe Community For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • When opening a pdf document in Adobe Reader the font of the original document is changed....It becomes a mix of the original font and a new different font. How can i fix this

    When opening a pdf document in Adobe Reader the font of the original document is changed....It becomes a mix of the original font and a new different font. How can i fix this

    This issue occurs with most of the PDFs that I open up. I am using the latest version of adobe reader on my windows based machine and it is a general PDF. I saw a similar post online stating that if you look at the fonts used in the document and it doesn't say (Embedded) next to it, then Adobe Reader will try to pull the font(s) from your computer and if it doesn't find that font then it will replace it which makes it look funny.

  • What is the font used in firefox in Windows 8

    hi
    i want to know what font is used in firefox in windows 8 ?
    this font is very good for persian characters
    now i'm using windows 7 and i want to have font style like in windows 8
    how can i change the settings

    Is this a font in the user interface or on web pages?
    You can right-click on a web page and select "Inspect Element" to open the Inspector (Firefox/Tools > Web Developer).
    You can check the font used for selected text in the Font tab in the right pane of the Inspector.
    *https://developer.mozilla.org/Tools/Page_Inspector

  • 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.

  • 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.

  • Fonts used in presentation - Way to display list?

    I've searched all over and can't find an answer to this. Maybe I didn't word my search right. Anyway, is there a way to list all the fonts used in a presentation so I can make sure that someone else knows what fonts they will need to display the presentation?
    I always try to use common use fonts, but sometimes that's not possible.
    Any help is appreciated. Thanks!

    Brad,
    I don't know if you've tried it, but if you look at the fonts list in the top left hand corner, you'll see a light gray line towards the top. The fonts listed above that line should be the ones you've most recently used. Presumably, those will be the ones in the presentation.
    Hope that helps!

  • 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.

Maybe you are looking for