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.
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.
Regards, Jon Summers LA Solutions
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: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?
Is there a way to tell if a font has been changed or some kind of flag is set?
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
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!
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
Mike Robertson said:Would you need to parse all the text & text nodes to see what font was being used to cover when "None" was the textstyle?
Yes — but one step at a time!
Jon,
Would you need to parse all the text & text nodes to see what font was being used to cover when "None" was the textstyle?
When MicroStation first opens a DGN file, it provides a list of missing fonts in the Message Center.
If you want to do the same programmatically, then enumerate all text styles (found in DGNLibs). Compare the font used by each style with the available Windows fonts.