I’m trying to figure out if there is a way to get a list of missing fonts either by the message center or other means using the API. I want to be able to pull this into a list so that we can make sure the fonts are added to the completed projects.
Hi James Griffith,
Sorry, I do not have a C# code snip readily available though you should be able to:
DgnFontListPtr allFonts = DgnFontManager::CreateKnownFontList (ISessionMgr::GetActiveDgnFile (), (DgnFontFilter)(DgnFontFilter::Resource | DgnFontFilter::Shx | DgnFontFilter::ShxBig | DgnFontFilter::Symbol | DgnFontFilter::TrueType | DgnFontFilter::Missing | DgnFontFilter::Hidden));
HTH,Bob
Robert Hook said:In C# call using a similar construct to the ListAllFonts() C++ Code Snippet
It's good to see an example. Unfortunately the formatting of that Wiki almost hides the C++ code!
Regards, Jon Summers LA Solutions
Hi Jon Summers,
The original page linked has been removed and a new ListAllFonts() C++ Code Snippet entry made (1) level higher; since the original page (and other similar) had (2) issues:
Hopefully the new page (updated my original recommendation) is more presentable and others can be updated similarly if/when encountered.
Thank you,Bob
Is there a way to tell if a font has been changed or some kind of flag is set?
James Griffith said:Is there a way to tell if a font has been changed
A font where?
Windows stores TrueType Fonts (TTF) in its system folder. If you want to find when a system font has changed (a rare event) you need to write some Windows code.
Or are you asking if an event is raised if a MicroStation text style font is changed?
We are getting projects that have custom fonts used on text and not receiving the fonts with projects. The missing fonts are being set to standard or other default fonts when the file is opened. What I'm attempting to do is find these fonts that are missing and produce a list of them. I'm just not sure how to tell that the font was not found.
James Griffith said:What I'm attempting to do is find these fonts that are missing and produce a list of them. I'm just not sure how to tell that the font was not found
That's clearer!
In the MicroStationAPI, a DgnTextStyle has a DgnFont. A DgnFont has member properties...
DgnTextStyle
DgnFont
GetName ()
IsPresent ()
IsMissingFontReported ()
For a given DGN file, you must...
Those classes exist, with the same names, in the DgnPlatformNet API.