I have a requirement of installing the missing fonts in a document when the document is opened.
I have used the kMissingFontSignalResponderService to handle the missing font.
Because InDesign API does not provide any facility to install font, I have used the Windows API for the same.
When I get the missing font signal, I install the font using the ttf file and then broadcast the WM_FONTCHANGE message.
The problem is that I am not able to get the IPMFont instance of the just installed font. I require that instance to call the SetRequest(IPMFont*) method of IMissingFontSignalData. But I never get the instance for the recently installed font. Using methods like QueryFontByDisplayName in IFontMgr to get the IPMFont instance returns null for the installed font.
The font is indeed installed correctly but I am unable to notify the font manager about the new font.
Can anyone shed light to solve this issue?
Looking at the documentation, have you tried IFontMgr::ForceUpdateFontSystem()? It sounds like it would force a re-enumeration of fonts on the system and update the managers list. I'm guessing you would do this after installing the font and before trying to use it via various InDesign methods.
I tried ForceUpdateFontSystem too. Yet I do not get the IPMFont instance. Seems like the font manager is still unaware of the installed font. The font is indeed installed but the missing font alert appears once. If I open the document again there is no missing font alert as the font is indeed installed.
Can you kindly put some more inputs?
It was a long shot - ForceUpdateFontSystem() sounded like the right method for the job. I'd be suprised if there wasn't a way to do it within the InDesign framework. Unfortunately I'm busy at the moment, so can't look into it.