Font unavailable in script

I have written the following script to generate a font index in an InDesign document:
// Generate new document
var doc = app.documents.add();
var frm = doc.pages[0].textFrames.add();
var w = doc.documentPreferences.pageWidth;
var h = doc.documentPreferences.pageHeight;
frm.geometricBounds = [0.5, 0.5, 10.5, 8];
// Get list of all installed fonts and split into font family name and style arrays
var appFonts = app.fonts.everyItem().name;
var installedFonts = [];
var installedStyles = [];
var counter = -1;
for (var i = 0; i < appFonts.length; i++) {
    appFonts[i] = appFonts[i].split("\t");
    if (i == 0 || appFonts[i][0] != appFonts[i-1][0]) {
        installedFonts.push(appFonts[i][0]);
        counter ++;
        installedStyles[counter] = [];
    installedStyles[counter].push(appFonts[i][1]);
// Loop on all font families and styles
var thisFont = "";
var thisStyle = "";
for (var i = 0; i < installedFonts.length; i++) {
    thisFont = installedFonts[i];
    for (var j = 0; j < installedStyles[i].length; j++) {
        thisStyle = installedStyles[i][j];
        frm.contents += thisFont + "-" + thisStyle + "\r";
        with (frm.paragraphs.item(-1)) {
            try {
                appliedFont = thisFont;
                try {
                    fontStyle = thisStyle;
                catch (errorVariable) {
                    appliedFont = "Times New Roman";
                    fontStyle = "Regular";
            catch (errorVariable) {
                appliedFont = "Times New Roman";
                fontStyle = "Regular";
            pointSize = 12;
            justification = Justification.leftAlign;
I added the try/catch statements because for certain fonts the script was aborting on the statement:
appliedFont = thisFont;
because it said the font was unavailable. Why can't I apply that font to some text if app.fonts.everyItem().name included it in the list?

Try setting both the font and the style in one command:
appliedFont = "Times New Roman\tRegular";
The 'appliedFont' command may fail if the original font style in there was something not available for TNR, such as 'narrow'. This oughta fix it.

Similar Messages

  • Font Size in Script

    Hi All,
    I want to change the font size in script. ( for eg :when i change the size
    to 8 or 10 it accepts but if i give 9 it does not. it gives the message "not SAP font
    size".) wat do i do to get the required size. pls reply.
    thanks.
    kavitha

    Hi Kavitha,
    Use the transaction SE73 and  goto system fonts and create your font size.
    Hope this helps you.
    Thanks
    Phani

  • How can change the font in the script output and the data grid ?

    How can change the font in the script output and the data grid in Sql Developer?

    You can't easily unless you have the latest version (2.1.1).
    If you do have this version then changing the font in the Tools/Preferences menu under the code editor/fonts section will also change the font of the data grid.
    For details of changing the fonts in an earlier version then see Sue's post below.
    http://sueharper.blogspot.com/2010/03/back-to-basics-changing-font-setting-in.html

  • Font missing CS4 script not working in CS5???

    hi, my font missing script is working in CS3, and CS4 but not working in CS4.
    I don't know why, any help please.
    Sam

    Object model has some changes in CS5.
    So use the below code in top of your script.
    app.scriptPreferences.version = 6.0;

  • Fonts unavailable in FM 8.0 but available in MS Word

    Several Futura and Garamond fonts were installed on my laptop but are not available in FM. When the documents are open containing these fonts, the "unavailable fonts" message boxes displays.
    When I access the Paragraph Designer and select the Default Font tab, a few of my paragraph tags, the font is displayed in gray. The three unavailable  fonts are Futura Book (Future Book BT True Type) , Garamond Book/Ultra Cond and Futura Light (Futura Light BT True Type).
    Any idea why I can use these fonts in Microsoft products but they seem to be unusable and are replaced in the FM Console?

    (1)     FM might mean FrameMaker. The original poster should let us know what he means by FM.
    (2)     In terms of Apple's support for fonts in FileMaker, in fact they only support TrueType fonts. They only support TrueType-flavoured versions of OpenType, not OpenType CFF fonts.
              - Dov

  • Serif italic fonts display as script

    In Firefox 7, web sites which have some text styled as serif italic display as a strange script. A good example is the recipe site URL below but the problem occurs on most Wikipedia pages as well.
    I am including a screen shot of the recipe page in the troubleshooting section so you can see how the recipe page displays for me.
    [http://www.markhannondesign.com/clientJobs/Firefox_Serif-Ital_Display.jpg screen shot]

    You can do a check for corrupted and duplicate fonts and other font issues:
    *http://www.thexlab.com/faqs/multipleappsquit.html - Font Book 2.0 Help: Checking for damaged fonts
    *http://www.creativetechs.com/iq/garbled_fonts_troubleshooting_guide.html

  • InDesign Fonts problem Bookmark Script

    Dear All,
    We developed one script for creation of Bookmark in InDesign CS2. When we are runnign this script content formatting is getting anmoly changed, I analyzed InDesign file and came to know that due to a font called "Trade Gothic Bold No. 2" due to this font all formatting of the content is getting change.
    But in script I am not doing anything with fonts, only we are untagging the content to take the reference for creation of bookmark. The script is working very fine for other files from last 6-7 months but only this file is having this kind of problem.
    If any one know the reason please let me know, I know this might be not related to scripting forum but if we recieved any issue related to it. Please let me know the solutions also how to aviod these kind of problem.
    Regards,
    Rajeev

    In all likelihood, you have based one or more of your paragraph styles on "[Basic Paragraph]". If the Basic Paragraph style differs from document to document, then when you paste text in it will change to match Basic Paragraph in this doc instead.
    Edit the styles in both documents to be based on "No Style" instead.

  • Fonts Unavailable on This Machine?

    I am getting this message when placing an EPS file (exported from CorelDraw v-14): "This file contains one or more fonts which are unavailable on this machine. Do you still want to place this file?" First of all, this just started. I have been previously able to perform this task without error messages concerning fonts. Secondly, how is it that a font can be unavailable on this machine, when all files have been created on the same machine?
    Note that I have selected EXPORT TEXT AS CURVES within the EPS Export dialogue box in CorelDraw v-14, so I am stunned that a font issue could even exist!
    Anyone have an idea what is causing this anomaly? I know this is going to cause me issues down the road with others within the organization as well as service bureaus. Thanx in advance for any suggestions and/or thoughts.

    “Presumably nothing else has changed on this machine, like updating Windows,…” (Peter Spier): I cannot say definitively that it has not. The system is set to make automatic updates, so this could be [an] issue.
    “… search for all AdobeFNT**.lst files, where ** is a number, and delete them…” (Peter Spier): Performed the search and found no such files to delete. Nice suggestion though. Thanx.
    “It is helpful to list what operating system you are using.” & “This is why it is important to post what operating system you use.” & “But I do believe that you can replace the font with standard Arial and it should be fine to use.” (Ozzwoman9): I certainly will not forget to provide the [OS] in the future. But, of course, try the old “uninstall/reinstall” routine! Thanx for this one!
    “As Peter suggested, opening the EPS in Illustrator and re-saving could solve it.” (Jongware): Excellent suggestion from both posters, and it certainly does solve the immediate dilemma.
    Follow-up to Problem: In going through all of your excellent suggestions and trying them one by one, I have discovered that the only offending “font” is Arial Normal-Italic. I will attempt a reinstall of the Arial font on this system as Ozzwoman9 suggested. Perhaps this will solve and end the difficulty. Something has changed in that regard, since in the past, when selecting Arial Italic, “Normal-“ did not appear in the choice to make. This didn’t register on me until I began to receive the error message.
    Thank you to all who posted and gave so generously of your time and knowledge! I will revisit this thread only in the event that a reinstall of the font proves unhelpful.

  • Change font type through scripting support.

    Please help me for this scripting support. . I have 100 of PSD with text. Text is brush script. I need to change font as some other font through scripting.

    With the Mail App you cannot change the font.

  • Default web font replaced by script font

    Hello everyone,
    For some strange reason one of the default web fonts is being replaced by a script font only in some pages (see attached image). I've tried to identify the font to disable it but haven't had any luck with it. I use FontExplorer Pro to manage all my fonts and I already tried disabling all fonts not belonging to the operating system but the issue still persists. Does anybody know what the name of this font is or how to solve the problem? I'd appreciate it very much.
    Thanks in advance!

    Thanks, Bee! But I just figured out that this problem is caused by disabling Georgia.
    There are several fonts that most likely I will never use (e.g. fonts for other languages, symbols), so I went ahead and disabled them in FontBook when I got my computer. It just occurred to me, after starting this thread, to go back to FontBook to enable all fonts and go in batches to try to pinpoint the font causing the problem. And so I found it! I figured that since I'm using FontExplorer Pro now I can manage them directly from it and not thru FontBook anymore.
    It was a painful task but it was worth doing it, knowing that many people can learn from my mistake.
    Thanks for the hand once again!

  • Font issue in scripts

    hi guru's,
                 im working on scripts,need help.i have a requirement to print heading with bold and big font size.i have changed the font sizes in Paragraph formats and character formats.and used them like this in text editor.
    P  <c1>ram</>
    p-para format
    C1-character format
    ram-hard coded text.
    jus confirm me if i shud use so10 or smartstyles for this or i can do it without them.
    thanks in advance.

    Hi Narendr,
    Please confirm if you have written the following in the script.
    P - <c1> RAM </>
    P is the paragraph format
    C1 is the character format for which bold option has been checked.
    Please check if you have used </> after the heading title.
    Thanks,
    Dishant

  • Help reqd for changing the font size in script(se71)

    hi all,
    im working on cheque printing in se71...there i want to change my text font
    differently for each text field in one window.
    i.e., for Pay/Beared Name : Font should be big and (Courier 10,say example)
    for Rupess field: less than the size of above one.
    how to do it...pls advise...
    *****note
    So far...i've not declared any default paragraph in my layout window.
    But i've so many pre-defined paragraph formats in my script.
    Pls do the needful and reply me in detail.
    thanks & regards
    sankar

    Hi nitin,
    Hi vishnu,
    what i did.....i've created a new character format as C1...
    and i've given in the code as u said....<C1>&amount&<>
    but it says...unknown format....(1st problem if i create new)
    2nd one....
    if i give the predefined one(available in character format)..then in change editor....it is changing into some code...
    if i give <k>&amount<>
    then it taking it as  <k>&amount</><K><()><>..like that
    pls advise...what changes i've to do
    thanks & regards
    sankar.

  • Why are arial narrow fonts unavailable in photoshop cc

    These fonts are installed in my Windows Fonts directory but dont show up in PS.

    That's intersting.
    On this particular windows 7 x64 system the Arial Narrow fonts are listed in both photoshop cc 2014 and photoshop cs6
    photoshop cc 2014
    photoshop cs6
    windows vista x64
    photoshop elements 8
    photoshop elements 2

  • Added fonts unavailable to users

    Hi
    Have added some extra fonts on a number of computers into the admin account fonts folder , which is where apps put their fonts and which are recognised, but these new ones are not availble for users who log on. If I log in as the Admin user on that computer, they show up fine, but if I log as a student of teacher user, the fonts don't show up in Word or Appleworks.
    Can anyone enlighten me on what I am doing wrong, or what I have to do to make these available to users. I copied them to the computers with ARD.
    thanks

    Have you tried putting them in
    ClientMachine HD> Library > Fonts ?
    If you want anyone who is logged into the client to be able to use the fonts, make sure that the font files are all at least Read Only for Everyone in the permissions.
    This works for us with all our network users on each client machine.
    If I correctly assume that what you mean by admin fonts folder is HD>Users>admin user>Library>Fonts, the admin account fonts folder on the client may only be available to the admin. Most user files in their own folder are limited to that user's access only.

  • Framemaker fonts unavailable

    Hello,
    We are transitioning FM users from windows xp sp3 to windows 7 64bit. Our FM users have been upgraded from FM7 to FM 10. We are completely stuck with FM missing all types of fonts. We have copied the fonts and installed from winxp machine to windows 7 and are still having major issues with fonts. The users have adobe 7.0 full installed and we are running msoffice 2010 32bit.  We also had to upgrade our print servers to 64bit drivers.  For example arial is one such issue:
    Couldn’t open CoverPage.fmThe "Arial Black Bolded" Font is not available.
    "Arial Black Heavy" will be used in this session.
    The "Arial Black" Font is not available.
    "Arial Black Heavy" will be used in this session.
    The "Arial Black Bolded" Font is not available.
    "Arial Black Heavy" will be used in this session.
    The "Arial Black" Font is not available.
    "Arial Black Heavy" will be used in this session.
    The "Arial Black Bolded" Font is not available.
    "Arial Black Heavy" will be used in this session.
    The "Arial Black" Font is not available.
    "Arial Black Heavy" will be used in this session.
    The "Arial Black Bolded" Font is not available.
    "Arial Black Heavy" will be used in this session.
    The "Arial Black" Font is not available.
    "Arial Black Heavy" will be used in this session.
    Couldn’t open CoverPage.fm
    We have tried unchecking the Preferences > remember missing fonts name" option and this did not work. We would appreciate any assistance with FM fonts as we are at a standstill. thank you

    I've found the answer to my problem and it's quite simple and what pretty much everyone has been saying but missed one tiny step.
    Everyone needs to have the old version windows xp fonts not the Windows 7 fonts. For example in windows 7 the arial font version is 5.06 and in windows xp the arial font is version 2.35
    1- Copy the arial font version 2.35 or the missing font in the old xp version
    2- Most important you have to install the fonts logged into the pc as the Administrator  not as a user with local admin rights.
    3 - Right click on the font and click install
    4- Reboot the pc
    5-Log into the pc and launch FM and open the FM file and the fonts will no longer be missing.
    Solved the issue

Maybe you are looking for

  • To pass the page parameters to a form in portal

    Hi, I am trying to develope a simple page using portal which contains 1. Simple parameter form. 2. Form that accepts the data from the simple parameter form. I want to pass 2 page parameters to this form(no.2) Is it possible to pass the page paramete

  • Using c-100 as smarthost

    Hey everyone, I have Exchange 2003 sending outbound mail to a Mail Marshal box ATM. I have just implimented 2 C-100's because the MM box just isn't cutting it anymore. The C-100's are setup and working perfectly with incoming mail, but as soon as I c

  • Issues while manually exporting from Data Manager

    Hi Guru's, When we try to export dat in Excel Or Text OR Access and select/tick Qualifiers for exporting then "Split qualified lookup fields into multiple rows" gets ticked automatically and greys it out,so cant even untick it...... This causes issue

  • Filters for retentions policies in OWA

    I created new retention policy 'Move messages older then 180 days' my Retention Policy works good but I need setup some filters filter for some email boxes filtered emails should stay in Inbox folder and does not move into archive folder how I can do

  • The problem of the background of Launchpad in Lion 10.7.3

    i used to change the background of Launchpad by pressing command+b in 10.7.2, why doesn't it work in 10.7.3!!!