InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnpInspectFontMgr Class Reference

Public Member Functions

 SnpInspectFontMgr ()
 
virtual ~SnpInspectFontMgr ()
 
ErrorCode ReportAllFonts ()
 
ErrorCode ReportFontGroup (const PMString &groupName)
 
ErrorCode IsFontAvailable (const PMString &fontName)
 
ErrorCode QueryFont (const PMString &fontName, IFontMgr::FontStyleBits fontStyleBits)
 
ErrorCode QueryFontPlatform (const PMString &fontName, IFontMgr::FontStyleBits fontStyleBits)
 
void ReportGroup (IFontMgr *fontMgr, IFontGroup *fontGroup, IPMStream *stream=nil)
 
void ReportFont (IPMFont *font, IPMStream *stream=nil)
 
ErrorCode ReportFontsWithRestrictions ()
 
ErrorCode TestAssetsForFonts (ISnpRunnableContext *runnableContext)
 
ErrorCode TestAssetsForFonts (UIDList assets)
 
ErrorCode ListFontsInDocument (IDocument *iDocument)
 
ErrorCode ListDocumentInstalledFonts (IDocument *iDocument)
 
ErrorCode ReportDocumentFontUsage (IDocument *iDocument)
 
ErrorCode InspectPersistFontUsage (IWorkspace *iWorkspace)
 

Detailed Description

Sample code snippet that shows how to use IFontMgr and IFontGroup to find fonts and reports their names using IPMFont.

Constructor & Destructor Documentation

SnpInspectFontMgr::SnpInspectFontMgr ()
inline

Constructor.

virtual SnpInspectFontMgr::~SnpInspectFontMgr ()
inlinevirtual

Destructor.

Member Function Documentation

ErrorCode SnpInspectFontMgr::InspectPersistFontUsage (IWorkspaceiWorkspace)

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
iWorkspaceIN the workspace of interest. Passing in the session workspace exposes the default fonts.
Returns
kSuccess on success
See Also
IDocFontMgr
ErrorCode SnpInspectFontMgr::IsFontAvailable (const PMStringfontName)

Uses IFontMgr::IsFontAvailable to check availability of the given font.

Parameters
fontNamepostscript font name e.g. "Courier-Bold"
Returns
kSuccess on success, kFailure otherwise.
ErrorCode SnpInspectFontMgr::ListDocumentInstalledFonts (IDocumentiDocument)

lists the document-installed fonts.

Parameters
iDocumentIN the document local fonts installed for
Returns
kSuccess on success
ErrorCode SnpInspectFontMgr::ListFontsInDocument (IDocumentiDocument)

lists the fonts used directly in the document. Fonts in notes are not reported, only fonts used in text page items.

Parameters
iDocumentIN the document to list the fonts from
Returns
kSuccess on success
See Also
IUsedFontList
ErrorCode SnpInspectFontMgr::QueryFont (const PMStringfontName,
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
fontNamepostscript font name e.g. "Courier-Bold"
fontStyleBitsdesired style variant see IFontMgr.h
Returns
kSuccess on success, kFailure otherwise.
ErrorCode SnpInspectFontMgr::QueryFontPlatform (const PMStringfontName,
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
fontNamename of the typeface on the platform e.g "Times New Roman" or "Courier"
fontStyleBitsdesired 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 (IDocumentiDocument)

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
iDocumentIN the document we are looking at
Returns
kSuccess on success
See Also
IDocumentFontUsage
ErrorCode SnpInspectFontMgr::ReportFontGroup (const PMStringgroupName)

Uses IFontMgr, IFontGroup and IPMFont to report the fonts in a given font group.

Parameters
groupNamesame 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
ErrorCode SnpInspectFontMgr::TestAssetsForFonts (ISnpRunnableContextrunnableContext)

Determines the list of fonts required by a placed asset

Parameters
runnableContextIN 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
assetsIN the assets to test
Returns
kFailure on failure