![]() | InDesign SDK 20.5 |
Public Member Functions | |
| SnpPerformCompFont () | |
| virtual | ~SnpPerformCompFont () |
| ErrorCode | CreateCompFont (IWorkspace *ws, const SnpCompositeFontData &data, UID &newCompFontUID) |
| ErrorCode | DeleteCompFont (IWorkspace *ws, const UID &compFontUIDToDelete) |
| ErrorCode | InspectCompFont (IWorkspace *ws, const UID &compFontUIDToInspect, SnpCompositeFontData &data) |
| void | SetCompositeFontData (IWorkspace *ws, IDocument *doc, const PMString &name, const UID &baseUID, SnpCompositeFontData &data) |
| ErrorCode | DoCreateFontCMap (IWorkspace *ws, const UID &newCompFontUID) |
| ErrorCode | DoForceCompFontUpdate (void) |
| void | ReportCompFontData (IDataBase *db, const SnpCompositeFontData &data) |
| K2Vector< PMString > | GetCompFontNames (IStyleNameTable *compFontNameTable) |
(1) Inspecting a composite font: Select one of the existing composite fonts to inspect. The data associated with the composite font will be written to the SNIPLOG.
(2) Creating a Composite font: Enter the name of your new composite font, and select which existing composite font you want to base it on. After creating a composite font, you can apply the new composite font on your text selection by simply using the Character Panel (or Text >> Font menu). If you want to do it programmatically, you can apply the kTextAttrFontUIDBoss attribute on the text model.
NOTE: If you are creating composite fonts using Japanese fonts and Japanese character classes, it is recommeded that you create them based on existing composite fonts, such as the default composite font. When you add character classes to a composite font, the priority by which a certain font setting is used is determined by how late it appears in the character class lists. For instance, if the hiragana character "A" appears in the "Kana" class (character class index 1) and a new character class "Hiragana Only" (character class index 7), then the font settings applied to character class index 7 will be used for this character when it appears on the layout. It is for this reason that an AddCompFontCharClassCmd is available, and a RemoveCompFontCharClassCmd isn't.
NOTE: When you are creating composite fonts for CJK languages other than Japanese (e.g. Chinese, Korean), make sure you do NOT use the default composite font as a basis. The characters specified in the character classes of the default composite font do not apply to other CJK languages.
(3) Deleting a composite font: Select one of the existing composite fonts to delete. After deleting, go to the Character Panel to verify that the composite font is gone.
About Composite Fonts:
"Composite fonts" are meta-fonts where specific fonts are used for predetermined sets of characters. For instance, in a composite font, you can use one font for Roman alphabet characters, another for kanji characters, another for kana characters, and yet another font for numerical characters.
While you do not need the Japanese version of InDesign to run this snippet, you will need the Japanese version of InDesign to create or view a composite font using the application user interface.
| inline |
Constructor.
| inlinevirtual |
Destructor.
| ErrorCode SnpPerformCompFont::CreateCompFont | ( | IWorkspace * | ws, |
| const SnpCompositeFontData & | data, | ||
| UID & | newCompFontUID | ||
| ) |
Creates a new composite font
| ws | IN The workspace on which the composite font will be created. Either kWorkspaceBoss or kDocWorkspaceBoss. |
| data | IN SnpCompositeFontData struct. Prefill before calling. |
| newCompFontUID | OUT The UID of the newly created composite font. |
| ErrorCode SnpPerformCompFont::DeleteCompFont | ( | IWorkspace * | ws, |
| const UID & | compFontUIDToDelete | ||
| ) |
Delete a composite font.
| ws | IN The workspace that contains the composite font to be deleted. |
| compFontUIDToDelete | IN The UID for the composite font that should be deleted. |
| ErrorCode SnpPerformCompFont::DoCreateFontCMap | ( | IWorkspace * | ws, |
| const UID & | newCompFontUID | ||
| ) |
Creates a CMap (character map) for the new composite font. Used by CreateCompFont.
| ws | IN The workspace on which the composite font is located. Either kWorkspaceBoss or kDocWorkspaceBoss. |
| newCompFontUID | IN The UID of the new composite font. |
| ErrorCode SnpPerformCompFont::DoForceCompFontUpdate | ( | void | ) |
Forces the font subsystem to do an update so that the new composite font is recognized.
| K2Vector< PMString > SnpPerformCompFont::GetCompFontNames | ( | IStyleNameTable * | compFontNameTable | ) |
Gets the names of the composite fonts.
| compFontNameTable | IN The IStyleNameTable interface for composite fonts on a specific workspace. |
| ErrorCode SnpPerformCompFont::InspectCompFont | ( | IWorkspace * | ws, |
| const UID & | compFontUIDToInspect, | ||
| SnpCompositeFontData & | data | ||
| ) |
Inspect a composite font.
| ws | IN The workspace that contains the composite font to be inspected. |
| compFontUIDToInspect | IN The UID for the composite font that is to be inspected. |
| data | OUT The composite font data for the given UID. |
| void SnpPerformCompFont::ReportCompFontData | ( | IDataBase * | db, |
| const SnpCompositeFontData & | data | ||
| ) |
Reports the composite font data to SNIPLOG.
| db | IN The database that contains the composite font. This is used to get other fonts interfaces in the SnpCompositeFontData structure. |
| data | IN The composite font data to report. |
| void SnpPerformCompFont::SetCompositeFontData | ( | IWorkspace * | ws, |
| IDocument * | doc, | ||
| const PMString & | name, | ||
| const UID & | baseUID, | ||
| SnpCompositeFontData & | data | ||
| ) |
Sets the composite font data structure with sensible defaults. Call this method before calling the CreateCompFont() method.
NOTE: You can modify the contents to suite your needs.
| ws | IN The workspace on which the composite font will be created. Either kWorkspaceBoss or kDocWorkspaceBoss. |
| doc | IN The to correlate with the composite font. This is optional. |
| name | IN The name of the new composite font. |
| baseUID | IN The UID of the composite font on which you want to base the new one. If this is NOT kInvalidUID, that means you want to make a new composite font based on a specific existing composite font. In that case, all of the composite font data settings will be inherited. Also, any added character classes will simply be added on to the inherited character classes from the baseUID font. If you set this to kInvalidUID, the new composite font will be based on the default composite font in the workspace, with additional characteristics that you specify in the SnpCompositeFontData structure. |
| data | OUT SnpCompositeFontData struct. This method fills out the structure. |