Skip to main content
Fightergator
Inspiring
January 11, 2023
Answered

SimpleOpen Does Not Work; Console Reports Font Is Not Available

  • January 11, 2023
  • 2 replies
  • 1111 views

I have a script to open a series of documents with tables in each.  It's been working fine until I disabled some of the FrameMaker fonts I never use (Asian fonts per an earlier post).  Now one of my documents won't open from the script.  When I try to open it, the console pops open saying the "MinionPro-Regular" Font is not available.  "Times New Roman" will be used in this session.  I've used the paragraph designer and character designer to  apply the "Times New Roman font to my entire document, but still doesn't work.  Any suggestions?

    This topic has been closed for replies.
    Correct answer Bob_Niland

    Rendering the document to PDF, then checking Properties:Fonts in a suitable PDF reader (such as Acrobat) will report the fonts actually used.

    2 replies

    Legend
    January 11, 2023

    I believe also that if a font is referenced by a paragraph or character format, even if it is not used in any actual text, will trigger this warning. I would review all the formats and make adjustments as necessary. Also, as a last resort, one trick is to save the file as MIF and do a text search for the font name, to see where it is hiding.

     

    I do not think SimpleOpen() will work silently with missing fonts. If you do not resolve the font problem, you will need to use Open() with Constants.FS_FontNotFoundInCatalog set to Constants.FV_DoOK. That's a little more complicated but it is not outrageous. Here is a general function I use to open files:

     

    function file_OpenFile(path, ignoreErrors, ignoreLock, hidden, allowNonWriteable)
    {
        var index;
    
        var props = GetOpenDefaultParams();
    
        index = GetPropIndex(props, Constants.FS_FileIsStructured);
        props[index].propVal.ival = Constants.FV_StripStructureAndOpen;
     
        index = GetPropIndex(props, Constants.FS_AlertUserAboutFailure);
        if(ignoreErrors)
            props[index].propVal.ival = false;
        else
            props[index].propVal.ival = true;
            
        index = GetPropIndex(props, Constants.FS_BookIsInUse);
        if(ignoreLock)
            props[index].propVal.ival = Constants.FV_ResetLockAndContinue;
        else
            props[index].propVal.ival = Constants.FV_DoCancel;
            
        index = GetPropIndex(props, Constants.FS_DisallowMIF);
        props[index].propVal.ival = false;
            
        index = GetPropIndex(props, Constants.FS_DisallowXml);
        props[index].propVal.ival = false;
            
        index = GetPropIndex(props, Constants.FS_DontNotifyAPIClients);
        props[index].propVal.ival = true;
            
        index = GetPropIndex(props, Constants.FS_FileIsOldVersion);
        props[index].propVal.ival = Constants.FV_DoOK;
            
        index = GetPropIndex(props, Constants.FS_FileIsInUse);
        if(ignoreLock)
            props[index].propVal.ival = Constants.FV_ResetLockAndContinue;
        else
            props[index].propVal.ival = Constants.FV_DoCancel;
            
        index = GetPropIndex(props, Constants.FS_FontChangedMetric);
        if(ignoreErrors)
            props[index].propVal.ival = Constants.FV_DoOK;
        else
            props[index].propVal.ival = Constants.FV_DoCancel;
            
        index = GetPropIndex(props, Constants.FS_FontNotFoundInCatalog);
        if(ignoreErrors)
            props[index].propVal.ival = Constants.FV_DoOK;
        else
            props[index].propVal.ival = Constants.FV_DoCancel;
            
        index = GetPropIndex(props, Constants.FS_FontNotFoundInDoc);
        if(ignoreErrors)
            props[index].propVal.ival = Constants.FV_DoOK;
        else
            props[index].propVal.ival = Constants.FV_DoCancel;
            
        index = GetPropIndex(props, Constants.FS_LanguageNotAvailable);
        if(ignoreErrors)
            props[index].propVal.ival = Constants.FV_DoOK;
        else
            props[index].propVal.ival = Constants.FV_DoCancel;
            
        index = GetPropIndex(props, Constants.FS_LockCantBeReset);
        if(ignoreLock)
            props[index].propVal.ival = Constants.FV_DoOK;
        else
            props[index].propVal.ival = Constants.FV_DoCancel;
            
        index = GetPropIndex(props, Constants.FS_MakeVisible);
        if(hidden)
            props[index].propVal.ival = false;
        else
            props[index].propVal.ival = true;
            
        index = GetPropIndex(props, Constants.FS_NewDoc);
        props[index].propVal.ival = false;
            
        index = GetPropIndex(props, Constants.FS_OpenAsType);
        props[index].propVal.ival = Constants.FV_AUTORECOGNIZE;
            
        index = GetPropIndex(props, Constants.FS_OpenBookViewOnly);
        props[index].propVal.ival = false;
            
        index = GetPropIndex(props, Constants.FS_OpenDocViewOnly);
        props[index].propVal.ival = false;
            
        index = GetPropIndex(props, Constants.FS_UseAutoSaveFile);
        props[index].propVal.ival = Constants.FV_DoNo;
            
        index = GetPropIndex(props, Constants.FS_UpdateTextReferences);
        props[index].propVal.ival = Constants.FV_DoNo;
            
        index = GetPropIndex(props, Constants.FS_UpdateXRefs);
        props[index].propVal.ival = Constants.FV_DoNo;
            
        index = GetPropIndex(props, Constants.FS_UseRecoverFile);
        props[index].propVal.ival = Constants.FV_DoNo;
            
        index = GetPropIndex(props, Constants.FS_UseAutoSaveFile);
        props[index].propVal.ival = Constants.FV_DoNo;
            
        index = GetPropIndex(props, Constants.FS_OpenFileNotWritable);
        if(allowNonWriteable)
            props[index].propVal.ival = Constants.FV_DoOK;
        else
            props[index].propVal.ival = Constants.FV_DoCancel;
            
        index = GetPropIndex(props, Constants.FS_RefFileNotFound);
        if(ignoreErrors)
            props[index].propVal.ival = Constants.FV_DoOK;
        else
            props[index].propVal.ival = Constants.FV_AllowAllRefFilesUnFindable;
            
      
        //open the document
        var returnp = new PropVals();
        var file = Open(path, props, returnp);
     
      
        if(file.ObjectValid() && hidden)
            file.IsOnScreen = false;
        else if(file.ObjectValid())
            file.IsOnScreen = true;
            
        if(!file.ObjectValid() file = null;
        return file;
    }    

     

    Hope this helps,

    Russ

     

    Fightergator
    Inspiring
    January 11, 2023

    Thanks to all of you...all good answers.  I didn't know about using MIF or PDF to find a hidden font.  I'll try that first if this happens in future.  Russ, thanks for reminder about the Open() with Constant.FS function.  I recall Rick and someone else (maybe you) recommending using that code in the past, but have been too lazy until now.  Will incorporate it and use it in the future. 

    Fightergator
    Inspiring
    January 13, 2023

    I saved the file as MIF and found the Minion Pro font used in two cells, if I'm interpreting the MIF file correctly.  I wasn't sure what the best way to fix it was, so I cut the two cells from <Cell> to <Cell End> both places I found it.  I saved the MIF file with my text editor and reopened it in FrameMaker and I no longer had a problem with the font missing message.  Can anyone tell me if that's the best way to handle it?

    Community Expert
    January 11, 2023

    Hi,

     

    It could be that this font is used on a reference ot master page. Or in a text which is not in a text frame but created with the text line tool.

    You might save the file as MIF and open the MIF file with a text editor and search for Minion.

     

    A specific font can also be in a table format. However, when the table format is not used, I think that FrameMaker will not show a message about missing fonts.

     

    Best regards

     

    Winfried

    Bob_Niland
    Community Expert
    Bob_NilandCommunity ExpertCorrect answer
    Community Expert
    January 11, 2023

    Rendering the document to PDF, then checking Properties:Fonts in a suitable PDF reader (such as Acrobat) will report the fonts actually used.

    Fightergator
    Inspiring
    January 13, 2023

    Bob...The font show up when in the PDF properties, like you said, but is there anyway to tell where the font is hidden in FrameMaker?  So far, the only way I can find to get rid of it is to delete each instance from the MIF file, save it, and then load it into FrameMaker.  Is there a better way to do this?