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

#include <IGlyphUtilsME.h>

Inheritance diagram for IGlyphUtilsME:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IGLYPHUTILSME }
 

Public Member Functions

virtual void InsertTheCharacter (ISelectionManager *selMgr, IPMFont *font, LanguageID id, const GlyphEntry *baseGlyphEntry, const GlyphEntry *alternateGlyphEntry, bool16 selectChar=kFalse, bool16 setFont=kFalse)=0
 
virtual int32 GetSelectionGlyphSet (IPMFont *font, IFontInstance *fontInstance, LanguageID id, const WideString &chars, Text::GlyphID glyph, GlyphSet *glyphSet, GlyphSet::GlyphSortOrder sortOrder=GlyphSet::kNoOrder)=0
 
virtual int32 GetGlyphListGlyphSet (IPMFont *font, IFontInstance *fontInstance, LanguageID id, Text::GlyphID *glyphs, int32 numGlyphs, GlyphSet *glyphSet, GlyphSet::GlyphSortOrder sortOrder=GlyphSet::kNoOrder)=0
 
virtual bool16 GetGlyphHasAlternate (IPMFont *font, LanguageID id, Text::GlyphID glyph, const char *tag=nil)=0
 
virtual unsigned GetGlyphAlternateCount (IPMFont *font, LanguageID id, Text::GlyphID glyph, const char *tag=nil)=0
 
virtual int32 GetEntireFont (IPMFont *font, LanguageID id, GlyphSet *glyphSet, GlyphSet::GlyphSortOrder sortOrder=GlyphSet::kNoOrder)=0
 
virtual int32 GetFilteredGlyphs (IPMFont *font, LanguageID id, GlyphSet *glyphSet, GlyphFilterProcList &includeFilterProcList, GlyphFilterProcList &excludeFilterProcList, GlyphSet::GlyphSortOrder sortOrder=GlyphSet::kNoOrder)=0
 
virtual int32 GetOTFFeatureGlyphSet (const char *tags, int32 numTags, IPMFont *font, LanguageID id, GlyphSet *glyphSet, GlyphSet::GlyphSortOrder sortOrder=GlyphSet::kNoOrder)=0
 
virtual bool16 GetOTFFeature (IPMFont *font, IFontInstance *fontInstance, LanguageID id, const GlyphEntry *baseGlyph, const GlyphEntry *alternate, char *tagBuffer, int32 &choice)=0
 
virtual int32 GetGlyphsForFeatureAccessInfo (const char *tags, int32 numTags, IPMFont *font, LanguageID id, GlyphSet *glyphSet)=0
 
virtual int32 GetGlyphAccessInfo (Text::GlyphID glyphID, IPMFont *font, LanguageID id, GlyphAccessData *glyphAccessData)=0
 
virtual int32 GetGlyphAllAccessInfo (Text::GlyphID glyphID, IPMFont *font, LanguageID langID, K2Vector< GlyphAccessData * > &glyphAccessDataList)=0
 
virtual bool16 TestFeatureSubstitution (IFontInstance *fontInstance, LanguageID id, const WideString &textString, char *tags, int32 *choices, int32 numFeatures, Text::GlyphID testGlyphID)=0
 
virtual void GetOTFAttribute (char *tags, int32 choice, AttributeBossList *attrBossList, OpenTypeFeatureList &featureList, int32 &form, IFontInstance *fontInstance, LanguageID id, const WideString &stringToApply, Text::GlyphID g)=0
 
virtual void InsertTheCharacterAtRange (ISelectionManager *selMgr, IPMFont *font, LanguageID id, const GlyphEntry *baseGlyphEntry, const GlyphEntry *alternateGlyphEntry, bool16 selectChar=kFalse, bool16 setFont=kFalse, TextIndex start=kInvalidTextIndex, TextIndex end=kInvalidTextIndex, const RangeData *rangeToSelect=nil)=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

Utilities for dealing with glyphs focusing on the complex-script aspects, especially.

Member Function Documentation

virtual int32 IGlyphUtilsME::GetEntireFont (IPMFontfont,
LanguageID id,
GlyphSetglyphSet,
GlyphSet::GlyphSortOrder sortOrder = GlyphSet::kNoOrder 
)
pure virtual

Get all glyphs in font

Parameters
fontfont to get glyphs in
idLanguage id
glyphSetOUT all glyphs in font
sortOrderhow the returned glyph set should be sorted
Returns
int32 number of glyphs in glyphSet
virtual int32 IGlyphUtilsME::GetFilteredGlyphs (IPMFontfont,
LanguageID id,
GlyphSetglyphSet,
GlyphFilterProcListincludeFilterProcList,
GlyphFilterProcListexcludeFilterProcList,
GlyphSet::GlyphSortOrder sortOrder = GlyphSet::kNoOrder 
)
pure virtual

Get all glyphs in a font that satisfy the given filter function (typically from UnicodeClass).

Parameters
fontfont to get glyphs for
idLanguage id
glyphSetOUT filtered glyphs in font meeting the filter function(s) condition(s).
includeFilterProcLista list of function pointers to use to filter "in" the glyphs in the font, typically from UnicodeClass.h. GlyphFilterProcList filterArray; filterArray.push_back(&UnicodeClass::IsPunctuationOpen()); filterArray.push_back(&UnicodeClass::IsPunctuationClose());
excludeFilterProcLista list of function pointers to use to further filter "out" the glyphs in the font captured by the includeFilterProcList, typically from UnicodeClass.h.
sortOrderhow the returned glyph set should be sorted
Returns
int32 number of glyphs in glyphSet
See Also
UnicodeClass.h for type definitions for filter procs.
virtual int32 IGlyphUtilsME::GetGlyphAccessInfo (Text::GlyphID glyphID,
IPMFontfont,
LanguageID id,
GlyphAccessDataglyphAccessData 
)
pure virtual

Sets glyphAccessData->fDesiredTag to global gDesiredTag. Calls IPMFont::GetOTGlyphAccess. External code should not use this and call IPMFont::GetOTGlyphAccess instead.

Parameters
glyphIDglyph id to get access for
fontfont glyph id is in
idLanguage id.
glyphAccessDataaccess data
Returns
int32 0 if success. 1 if failure.
virtual int32 IGlyphUtilsME::GetGlyphAllAccessInfo (Text::GlyphID glyphID,
IPMFontfont,
LanguageID langID,
K2Vector< GlyphAccessData * > & glyphAccessDataList 
)
pure virtual

Sets glyphAccessData->fDesiredTag to global gDesiredTag. Calls IPMFont::GetAllOTGlyphAccess. External code should not use this and call IPMFont::GetAllOTGlyphAccess instead.

Parameters
glyphIDglyph id to get access for
fontfont glyph id is in
idLanguage id.
glyphAccessDatavector of access data
Returns
int32 0 if success. 1 if failure.
virtual unsigned IGlyphUtilsME::GetGlyphAlternateCount (IPMFontfont,
LanguageID id,
Text::GlyphID glyph,
const char * tag = nil 
)
pure virtual

Determine how many alternate with a given OpenType feature tag the glyph has.

Parameters
fontfont to look for alternate glyph in
idLanguage id.
glyphglyph to look for alternate
tagOpenType feature tag to look for. 'aalt' if set to nil.
Returns
uint16 the number of alternates with the OpenType feature tag.
virtual bool16 IGlyphUtilsME::GetGlyphHasAlternate (IPMFontfont,
LanguageID id,
Text::GlyphID glyph,
const char * tag = nil 
)
pure virtual

Determine if glyph has alternate with a given OpenType feature tag.

Parameters
fontfont to look for alternate glyph in
idLanguage id.
glyphglyph to look for alternate
tagOpenType feature tag to look for. 'aalt' if set to nil.
Returns
bool16 kTrue if there is an alternate with OpenType feature tag.
virtual int32 IGlyphUtilsME::GetGlyphListGlyphSet (IPMFontfont,
IFontInstancefontInstance,
LanguageID id,
Text::GlyphID * glyphs,
int32 numGlyphs,
GlyphSetglyphSet,
GlyphSet::GlyphSortOrder sortOrder = GlyphSet::kNoOrder 
)
pure virtual

Get alternates for glyphs

Parameters
fontfont to get glyph alternates in
fontInstancefont instance to get glyph alternates in. needs to be an instance of font
idLanguage id.
glyphsglyphs to find alternates for
numGlyphsnumber of glyphs. must be < 20 (kMaxStrikes).
glyphSetOUT set of glyph alternates.
sortOrderhow the returned glyph set should be sorted
Returns
int32 returns length of glyphset. returns 0 if numGlyphs was >=20.
virtual int32 IGlyphUtilsME::GetGlyphsForFeatureAccessInfo (const char * tags,
int32 numTags,
IPMFontfont,
LanguageID id,
GlyphSetglyphSet 
)
pure virtual

Get glyphs for a OpenType feature

Parameters
tagsOpenType features to get glyphs for
numTagsnumber of OpenType features
fontfont to get glyphs in
idLanguage id.
glyphSetOUT glyphs with OpenType features
Returns
int32 1 if has alternates. 0 if no alternates.
virtual void IGlyphUtilsME::GetOTFAttribute (char * tags,
int32 choice,
AttributeBossListattrBossList,
OpenTypeFeatureListfeatureList,
int32 & form,
IFontInstancefontInstance,
LanguageID id,
const WideStringstringToApply,
Text::GlyphID g 
)
pure virtual

Get an attribute for an open type feature. Return if a suitable one was found.

Parameters
tagsOpenType feature to get attribute for
choicevalue of OTF feature chosen from tags array
attrBossListOUT attribute for the open type feature
featureListOUT
formOUT
fontInstancefont instance to get attribute for.
idLanguage id.
stringToApplystring to get OTF attribute for
gglyphID to get OTF attribute for
virtual bool16 IGlyphUtilsME::GetOTFFeature (IPMFontfont,
IFontInstancefontInstance,
LanguageID id,
const GlyphEntrybaseGlyph,
const GlyphEntryalternate,
char * tagBuffer,
int32 & choice 
)
pure virtual

Try and find an open type feature for the font/glyph combo. Return if a suitable one was found. Probably INTERNAL use only.

Parameters
fontfont glyph id is in
fontInstancefont instance to get OTF feature for. needs to be an instance of font
idLanguage id.
baseGlyphentry of base glyph
alternateentry of alternate glyph
tagsOpenType features to get glyphs for
choiceOUT return index value of OTF feature chosen from tags array.
Returns
bool16 whether the particular feature was found
virtual int32 IGlyphUtilsME::GetOTFFeatureGlyphSet (const char * tags,
int32 numTags,
IPMFontfont,
LanguageID id,
GlyphSetglyphSet,
GlyphSet::GlyphSortOrder sortOrder = GlyphSet::kNoOrder 
)
pure virtual

Get glyphs for a OpenType feature. Also sets global gDesiredTag that is used by GetGlyphAccessInfo for what OpenType feature to prefer.

Parameters
tagsOpenType features to get glyphs for
numTagsnumber of OpenType features
fontfont to get glyphs in
idLanguage id.
glyphSetOUT glyphs with OpenType features
sortOrderhow the returned glyph set should be sorted
Returns
int32 number of glyphs in glyphSet
virtual int32 IGlyphUtilsME::GetSelectionGlyphSet (IPMFontfont,
IFontInstancefontInstance,
LanguageID id,
const WideStringchars,
Text::GlyphID glyph,
GlyphSetglyphSet,
GlyphSet::GlyphSortOrder sortOrder = GlyphSet::kNoOrder 
)
pure virtual

Gets alternate glyph values for a given glyph.

Parameters
fontfont to get glyph alternates in
fontInstancefont instance to get glyph alternates in. needs to be an instance of font
idLanguage id.
charsunicode value(s) for glyph. multiple values only if glyph is a combination of unicode values like a ligature.
glyphglyph to get alternates for
glyphSetOUT set of glyph alternates.
sortOrderhow the returned glyph set should be sorted
Returns
int32 returns length of glyphset.
virtual void IGlyphUtilsME::InsertTheCharacter (ISelectionManagerselMgr,
IPMFontfont,
LanguageID id,
const GlyphEntrybaseGlyphEntry,
const GlyphEntryalternateGlyphEntry,
bool16 selectChar = kFalse,
bool16 setFont = kFalse 
)
pure virtual

Inserts a glyph into textmodel. This API is deprecated. Please use InsertTheCharacterAtRange instead.

Parameters
*setMgrselection manager
*fontfont of glyph.
idLanguage id.
*baseGlyphEntryentry of base glyph
*alternateGlyphEntryentry of alternate glyph
selectCharselect glyph inserted
setFontset font of glyph to font passed in. font is restored to previous font after insertion
Returns
unicode character value. 0 if in PUA area and userArea is not nil.
virtual void IGlyphUtilsME::InsertTheCharacterAtRange (ISelectionManagerselMgr,
IPMFontfont,
LanguageID id,
const GlyphEntrybaseGlyphEntry,
const GlyphEntryalternateGlyphEntry,
bool16 selectChar = kFalse,
bool16 setFont = kFalse,
TextIndex start = kInvalidTextIndex,
TextIndex end = kInvalidTextIndex,
const RangeDatarangeToSelect = nil 
)
pure virtual
Inserts a glyph into textmodel

Parameters
*setMgrselection manager
*fontfont of glyph.
idLanguage id.
*baseGlyphEntryentry of base glyph
*alternateGlyphEntryentry of alternate glyph
selectCharselect glyph inserted
setFontset font of glyph to font passed in. font is restored to previous font after insertion
startText index from where to insert. If this is not provided, then selection is taken as default.
endText index till where to insert. If this is not provided, then selection is taken as default.
rangeToSelectSelect this range of text after replacing the character.
Returns
unicode character value. 0 if in PUA area and userArea is not nil.
virtual bool16 IGlyphUtilsME::TestFeatureSubstitution (IFontInstancefontInstance,
LanguageID id,
const WideStringtextString,
char * tags,
int32 * choices,
int32 numFeatures,
Text::GlyphID testGlyphID 
)
pure virtual

Description Probably INTERNAL use only.

Parameters
fontInstancefont instance to test out application of OTF features. needs to be an instance of font
idLanguage id.
textStringa string of length 1 to apply OTF the feature to
tagsOpenType features array
choicesarray of choice for features. count is the same as numFeatures.
numFeaturesnumber of features in features variable
testGlyphID
Returns
kTrue if feature can be applied, kFalse if not
See Also
IFontInstance.h, ApplyFeatures