Sample code snippet that shows how to use IFontMgr and IFontGroup to find fonts and reports their names using IPMFont.
| SnpInspectFontMgr::SnpInspectFontMgr | ( | | ) | |
| inline |
| virtual SnpInspectFontMgr::~SnpInspectFontMgr | ( | | ) | |
| inlinevirtual |
| ErrorCode SnpInspectFontMgr::InspectPersistFontUsage | ( | IWorkspace * | iWorkspace | ) | |
Details the set of fonts that persist (persistent boss class kFontGroupBoss) in the (session or document) workspace. To examine the session workspace, call with no document open. The fonts reported here are the fonts that exist in the document, including the default set of fonts available in the session workspace.
- Parameters
| iWorkspace | IN the workspace of interest. Passing in the session workspace exposes the default fonts. |
- Returns
- kSuccess on success
- See Also
- IDocFontMgr
| ErrorCode SnpInspectFontMgr::IsFontAvailable | ( | const PMString & | fontName | ) | |
Uses IFontMgr::IsFontAvailable to check availability of the given font.
- Parameters
| fontName | postscript font name e.g. "Courier-Bold" |
- Returns
- kSuccess on success, kFailure otherwise.
| ErrorCode SnpInspectFontMgr::ListDocumentInstalledFonts | ( | IDocument * | iDocument | ) | |
lists the document-installed fonts.
- Parameters
| iDocument | IN the document local fonts installed for |
- Returns
- kSuccess on success
| ErrorCode SnpInspectFontMgr::ListFontsInDocument | ( | IDocument * | iDocument | ) | |
lists the fonts used directly in the document. Fonts in notes are not reported, only fonts used in text page items.
- Parameters
| iDocument | IN the document to list the fonts from |
- Returns
- kSuccess on success
- See Also
- IUsedFontList
| ErrorCode SnpInspectFontMgr::QueryFont | ( | const PMString & | fontName, |
| | IFontMgr::FontStyleBits | fontStyleBits |
| ) | | |
Use the calls shown by this method to get an IPMFont when you have a Postscript font name.
Uses IFontMgr::QueryFont and IPMFont to report info on the given font. Using the fontStyleBits parameter you can report on a stylistic variant of the given font. For example:
QueryFont("Courier-Bold", IFontMgr::kItalic)
reports on postscript font "Courier-Oblique".
- Parameters
| fontName | postscript font name e.g. "Courier-Bold" |
| fontStyleBits | desired style variant see IFontMgr.h |
- Returns
- kSuccess on success, kFailure otherwise.
| ErrorCode SnpInspectFontMgr::QueryFontPlatform | ( | const PMString & | fontName, |
| | IFontMgr::FontStyleBits | fontStyleBits |
| ) | | |
Use the calls shown in this method to get an IPMFont when you have the name of the typeface on a given platform. This is the typeface name on Windows or a font family name on Mac.
Uses IFontMgr::QueryFontPlatform and IPMFont to report info on the given font. Using the fontStyleBits parameter you can report on a stylistic variant.
- Parameters
| fontName | name of the typeface on the platform e.g "Times New Roman" or "Courier" |
| fontStyleBits | desired variant see IFontMgr.h |
| ErrorCode SnpInspectFontMgr::ReportAllFonts | ( | | ) | |
Uses IFontMgr, IFontGroup and IPMFont to report all the fonts available to the application.
- Returns
- kSuccess on success, kFailure otherwise.
| ErrorCode SnpInspectFontMgr::ReportDocumentFontUsage | ( | IDocument * | iDocument | ) | |
Reports the use of fonts in a document, including all text in text frames, along with any fonts in placed assets (PDFs or EPS). Fonts in notes are not reported.
- Parameters
| iDocument | IN the document we are looking at |
- Returns
- kSuccess on success
- See Also
- IDocumentFontUsage
| ErrorCode SnpInspectFontMgr::ReportFontGroup | ( | const PMString & | groupName | ) | |
Uses IFontMgr, IFontGroup and IPMFont to report the fonts in a given font group.
- Parameters
| groupName | same as family name e.g. Times, Arial, Courier, Times New Roman |
- Returns
- kSuccess on success, kFailure otherwise.
| ErrorCode SnpInspectFontMgr::ReportFontsWithRestrictions | ( | | ) | |
Reports all fonts supported by the application (cooltype) that have restrictions on their use.
- Returns
- kSuccess on success
Determines the list of fonts required by a placed asset
- Parameters
| runnableContext | IN the context |
- Returns
- kFailure on failure
| ErrorCode SnpInspectFontMgr::TestAssetsForFonts | ( | UIDList | assets | ) | |
Determines the list of fonts required by a placed assets identified through the UIDList
- Parameters
| assets | IN the assets to test |
- Returns
- kFailure on failure