![]() | InDesign SDK 20.5 |
Public Member Functions | |
| SnpPerformKinsokuTable () | |
| virtual | ~SnpPerformKinsokuTable () |
| ErrorCode | CreateKinsokuTable (IWorkspace *ws, const SnpKinsokuTableSettings &data, const UID &baseKinsokuTableUID, UID &newKinsokuTableUID) |
| ErrorCode | DeleteKinsokuTable (IWorkspace *ws, const UID &kinsokuTableUIDToDelete) |
| ErrorCode | InspectKinsokuTable (IWorkspace *ws, const UID &kinsokuTableUIDToInspect, SnpKinsokuTableSettings &data) |
| void | SetKinsokuTableSettings (const PMString &kinsokuTableName, SnpKinsokuTableSettings &data) |
| void | FilterDuplicateSettings (IWorkspace *ws, const UID &basedOnUID, SnpKinsokuTableSettings &data) |
| int32 | RemoveDuplicates (const WideString &baseString, WideString &addString) |
| bool16 | CanBeDeleted (IWorkspace *ws, const UID &kinsokuTableUIDToDelete) |
| void | ReportKinsokuTableData (const SnpKinsokuTableSettings &data) |
| void | ReportWideString (const WideString &s) |
| K2Vector< PMString > | GetKinsokuTableNames (IStyleNameTable *kinsokuNameTable) |
(1) Inspecting a kinsoku table: Select one of the existing kinsoku tables to inspect. The data associated with the kinsoku table will be written to the SNIPLOG.
(2) Creating a kinsoku table: Enter the name of your new kinsoku table, and select which existing kinsoku table you want to base it on. If you choose <none>, then a brand new kinsoku table will be made based on the root style. After creating a kinsoku table, you can apply the new kinsoku table on your text selection by simply using the Paragraph Panel If you want to do it programmatically, you can apply the kTAKinsokuTableBoss attribute on the text model.
(3) Deleting a kinsoku table: Select one of the existing kinsoku to delete. After deleting, go to the Paragraph Panel to verify that the kinsoku table is gone.
About Kinsoku tables:
"Kinsoku tables" are tables that contain a set of characters that define line break rules for the Japanese text composers. There are 4 kinds of line break rule classifications:
While you do not need the Japanese version of InDesign to run this snippet, you will need the Japanese version of InDesign to create a kinsoku table and apply to text, using the application user interface.
| inline |
Constructor.
| inlinevirtual |
Destructor.
| bool16 SnpPerformKinsokuTable::CanBeDeleted | ( | IWorkspace * | ws, |
| const UID & | kinsokuTableUIDToDelete | ||
| ) |
Determines if a kinsoku table is one that could be deleted.
| ws | IN The workspace that contains the kinsoku table to be deleted. |
| kinsokuTableUIDToDelete | IN The UID for the kinsoku table to be deleted. |
| ErrorCode SnpPerformKinsokuTable::CreateKinsokuTable | ( | IWorkspace * | ws, |
| const SnpKinsokuTableSettings & | data, | ||
| const UID & | baseKinsokuTableUID, | ||
| UID & | newKinsokuTableUID | ||
| ) |
Creates a new kinsoku table.
If the name of the new kinsoku table already exists in the kinsoku name table, then this method will point kinsokuTableUIDRef to the existing entry, and the characters will NOT be modified.
The additional characters are hardcoded in this snippet - modify them to suit your needs.
Use Cases:
| ws | IN The workspace on which the new kinsoku table should be created. |
| data | IN The kinsoku table data settings for the new kinsoku table. SnpKinsokuTableSettings is modelled after IKinsokuTable. |
| baseKinsokuTableUID | IN The UID of the kinsoku table to base the new one on. If you want to base the new kinsoku table on the Root style (empty), set this to kInvalidUID. |
| newKinsokuTableUID | OUT The newly created kinsoku table UID. |
| ErrorCode SnpPerformKinsokuTable::DeleteKinsokuTable | ( | IWorkspace * | ws, |
| const UID & | kinsokuTableUIDToDelete | ||
| ) |
Delete a kinsoku table.
| ws | IN The workspace that contains the kinsoku table to be deleted. |
| kinsokuTableUIDToDelete | IN The UID for the kinsoku table that should be deleted. |
| void SnpPerformKinsokuTable::FilterDuplicateSettings | ( | IWorkspace * | ws, |
| const UID & | basedOnUID, | ||
| SnpKinsokuTableSettings & | data | ||
| ) |
Filter out any duplicates in the settings before creating a new kinsoku table.
If we are basing the new kinsoku table on an existing one, the WideStrings in 'data' will simply be added on, but we are not supposed to have duplicates, or the Japanese text composer might get confused. This will remove duplicates.
| ws | IN The workspace on which the new kinsoku table should be created. |
| baseKinsokuTableUID | IN The UID of the kinsoku table to base the new one on. If you want to base the new kinsoku table on the Root style (empty), set this to kInvalidUID. |
| data | IN/OUT The kinsoku table data settings for the new kinsoku table. Pass IN what you want to add to the existing kinsoku table (identified by basedOnUID), and what you get OUT is only what needs to be added. |
| K2Vector< PMString > SnpPerformKinsokuTable::GetKinsokuTableNames | ( | IStyleNameTable * | kinsokuNameTable | ) |
Gets the names of the kinsoku tables.
| kinsokuNameTable | IN The IStyleNameTable interface for kinsoku tables on a specific workspace. |
| ErrorCode SnpPerformKinsokuTable::InspectKinsokuTable | ( | IWorkspace * | ws, |
| const UID & | kinsokuTableUIDToInspect, | ||
| SnpKinsokuTableSettings & | data | ||
| ) |
Inspect a kinsoku table.
| ws | IN The workspace that contains the kinsoku table to be inspected. |
| kinsokuTableUIDToInspect | IN The UID for the kinsoku table that is to be inspected. |
| data | OUT The kinsoku table settings for the given UID. |
| int32 SnpPerformKinsokuTable::RemoveDuplicates | ( | const WideString & | baseString, |
| WideString & | addString | ||
| ) |
Removes duplicate characters from WideStrings, so that the addString is left only with characters that don't belong in the baseString.
| baseString | IN The original string. |
| addString | IN/OUT The string with potentially duplicated characters. After this method is complete, addString should only contain characters that don't belong in baseString. |
| void SnpPerformKinsokuTable::ReportKinsokuTableData | ( | const SnpKinsokuTableSettings & | data | ) |
Reports the kinsoku table data to SNIPLOG.
| data | IN The kinsoku table settings to report. |
| void SnpPerformKinsokuTable::ReportWideString | ( | const WideString & | s | ) |
Reports characters in a WideString one by one to SNIPLOG.
| s | IN The WideString to report. |
| void SnpPerformKinsokuTable::SetKinsokuTableSettings | ( | const PMString & | kinsokuTableName, |
| SnpKinsokuTableSettings & | data | ||
| ) |
Sets the kinsoku table data structure with sensible defaults. Call this method before calling the CreateKinsokuTable() method.
NOTE: You can modify the contents to suite your needs.
| kinsokuTableName | IN The name of the new kinsoku table. |
| data | OUT SnpKinsokuTableSettings struct. This method fills out the structure. |