InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDocFontMgr Class Referenceabstract

#include <IDocFontMgr.h>

Inheritance diagram for IDocFontMgr:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IDOCFONTMGR }
 
enum  UpdateFlags { kDoNotUpdateDysfunctionalFamilies, kUpdateOnlyDysfunctionalFamilies }
 

Public Member Functions

virtual UID GetFontFamilyUID (const IFontGroupId *fontGroupIDPtr, bool16 makeOneIfNecessary=kTrue)=0
 
virtual UID GetFontGroupUID (IFontFamily *sourceFontFamily, bool16 makeOneIfNecessary=kTrue)=0
 
virtual UID GetFontFamilyUID (const IPMFont *font, bool16 makeOneIfNecessary=kTrue)=0
 
virtual UID GetFontFamilyUID (const PMString &displayFamilyName, PMString &fontStyle, bool16 makeOneIfNecessary=kTrue)=0
 
virtual UID GetFontGroupUIDWithFontFaceMappingInfo (const PMString &groupName, IFontFamily::FontFaceMappingInfo &FontFaceMappingInfo)=0
 
virtual UID GetFontFamilyUIDWithPostscriptName (const PMString &familyName, const FontEntry &fontEntry)=0
 
virtual IFontFamilyQueryFontGroup (const PMString &groupName, bool16 makeOneIfNecessary=kTrue)=0
 
virtual UID GetDefaultFamilyUID ()=0
 
virtual void Append (UID groupUID)=0
 
virtual void Remove (UID groupUID)=0
 
virtual int32 GetFontGroupCount () const =0
 
virtual UID GetNthFontGroupUID (int32 i) const =0
 
virtual void FontSystemChanged (void)=0
 
virtual bool16 UpdateCache (IUsedFontList *usedFontList, UpdateFlags updateFlag=kDoNotUpdateDysfunctionalFamilies)=0
 
virtual UID GetFontGroupUID (const PMString &groupName, bool16 makeOneIfNecessary=kTrue)=0
 
virtual UID GetFontGroupUIDWithFontEntry (const IFontMgr::FontNameInfo &fontNames)=0
 
virtual PMString GetTypekitFontID (const PMString &familyName, const PMString &styleName)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Provides a way to get IFontFamily UIDs. We used to use Family names to do this however Family names are no longer unique for different IFontFamily. Now we need to use fontGroupIDs to correctly get a IFontFamliy UID. Note that in this file GetFontGroupUID is the same as GetFontFamilyUID.

Member Function Documentation

virtual void IDocFontMgr::Append (UID groupUID)
pure virtual

Adds font family UID to doc font manager

Parameters
groupUIDfont family UID to add
virtual void IDocFontMgr::FontSystemChanged (void )
pure virtual

Called when font on system change to update the font families in doc font manager

virtual UID IDocFontMgr::GetDefaultFamilyUID ()
pure virtual

Using the default font name from the font manager gets the font family UID

Returns
UID font family UID
virtual UID IDocFontMgr::GetFontFamilyUID (const IFontGroupIdfontGroupIDPtr,
bool16 makeOneIfNecessary = kTrue 
)
pure virtual

Get IFontFamily UID from a IFontGroupId

Parameters
*fontGroupIDPtr
makeOneIfNecessaryIf kTrue and the IFontGroupId does not exist in the document the UID is created.
Returns
UID font family UID
virtual UID IDocFontMgr::GetFontFamilyUID (const IPMFontfont,
bool16 makeOneIfNecessary = kTrue 
)
pure virtual

Get IFontFamily UID from a font

Parameters
*fontUses postscript name and font type to find the IFontFamily
makeOneIfNecessaryIf kTrue and the font family does not exist in the document the UID is created.
Returns
UID font family UID
virtual UID IDocFontMgr::GetFontFamilyUID (const PMStringdisplayFamilyName,
PMStringfontStyle,
bool16 makeOneIfNecessary = kTrue 
)
pure virtual

Get IFontFamily UID from a familyname and optionally a style name

Parameters
displayFamilyNamename of family as it appears in the menu to users. This can be a native or non native name. it can also have a font type appended such as (TT). This call will try and find the font family that matches the font type.
fontStylepassing a fontStyle will help if there are 2 groups with the same name and the style name only exists in one of the groups. Passing an empty string causes style name not to be used. OUT on exit style name is updated to the non native style name as that is what we use in the text model. This value should be the empty string if you do not know it.
makeOneIfNecessaryIf kTrue and the font family does not exist in the document the UID is created.
Returns
UID
virtual UID IDocFontMgr::GetFontFamilyUIDWithPostscriptName (const PMStringfamilyName,
const FontEntryfontEntry 
)
pure virtual

This should not normally be called. The face entries are usually made automatically if the fonts are installed on the system. The purpose of GetFontFamilyUIDWithPostscriptName is to be able to make entries in the family face table for missing fonts for which we postscript name and font type. This is used by INX code to create font family entries for missing fonts.

Parameters
familyNamefamily name of font to find or add
fontEntrydata of font to find or add. this is the data that will be added to the font family if this font face is not found.
Returns
UID font family UID
virtual int32 IDocFontMgr::GetFontGroupCount () const
pure virtual

Gets count of font families in doc font manager

Returns
int32 count of font families
virtual UID IDocFontMgr::GetFontGroupUID (IFontFamilysourceFontFamily,
bool16 makeOneIfNecessary = kTrue 
)
pure virtual

You may need to create a group with a particular state. For instance, the font exists in on document, but not another. In the case that makeOneIfNecessary is set to kTrue. If the font does not exist in this document, it is copied from the supplied font. If it already exists, the copy is skipped and the UID is simply returned. (Note: No state is taken form the object if the group was found to be previously created.)

Parameters
sourceFontFamily
makeOneIfNecessaryIf kTrue and the IFontGroupId does not exist in the document the UID is created.
Returns
UID font family UID
virtual UID IDocFontMgr::GetFontGroupUID (const PMStringgroupName,
bool16 makeOneIfNecessary = kTrue 
)
pure virtual

DISCOURAGED. This does not support more than one group with the same family name. GetFontGroupUID returns a UID for the named group.

RECOMMENDATION - Use GetFontFamilyUID with IFontGroupId.

Parameters
groupNamefamily name. if 2 groups with family name first group is used.
makeOneIfNecessaryIf kTrue and the named group does not exist in the document the UID is created.
Returns
UID font family UID
virtual UID IDocFontMgr::GetFontGroupUIDWithFontEntry (const IFontMgr::FontNameInfofontNames)
pure virtual

DISCOURAGED. THIS ROUTINE DOES NOT SUPPORT FONT TYPE. We can have 2 postscript names with different font types. The purpose of GetFontGroupUIDWithFontEntry is to be able to make entries in the family face table for missing fonts for which we have the face name and postscript name. The face entries are usually made automatically if the fonts are installed on the system. FontNameInfo is defined in IFontMgr.h .

RECOMMENDATION - Use GetFontFamilyUIDWithPostscriptName

Parameters
fontNames
Returns
UID font family UID
virtual UID IDocFontMgr::GetFontGroupUIDWithFontFaceMappingInfo (const PMStringgroupName,
IFontFamily::FontFaceMappingInfoFontFaceMappingInfo 
)
pure virtual

Used to create fonts from non Adobe applications like Word.

Parameters
groupName
FontFaceMappingInfo
Returns
UID font family UID
virtual UID IDocFontMgr::GetNthFontGroupUID (int32 i) const
pure virtual

Gets the Nth font family in the doc font manger. Use with GetFontGroupCount to iterate thru all font families.

Parameters
iindex of font family to retrieve
Returns
UID font family UID
virtual IFontFamily* IDocFontMgr::QueryFontGroup (const PMStringgroupName,
bool16 makeOneIfNecessary = kTrue 
)
pure virtual

Similar to GetFontGroupUID but returns a IFontFamily. Not recommended to use this call. It does not support more than one group with the same family name.

Parameters
groupName
makeOneIfNecessary
Returns
IFontFamily*
virtual void IDocFontMgr::Remove (UID groupUID)
pure virtual

Removes font family UID to doc font manager

Parameters
groupUIDfont family UID to remove
virtual bool16 IDocFontMgr::UpdateCache (IUsedFontListusedFontList,
UpdateFlags updateFlag = kDoNotUpdateDysfunctionalFamilies 
)
pure virtual

Update the fontGroupIDs that are cached and used to find UIDs. Also updates IFontFamily which has cached a IFontGroup. Need to update dysfunctional families separtely because they can modify IDocFontMgr.

Parameters
usedFontListfonts used in the document
updateFlagwhether to update dysfunctional families
Returns
bool16 indicates whether any update occurred