![]() | InDesign SDK 20.5 |
Public Member Functions | |
| SnpApplyTextStyleAttributes () | |
| virtual | ~SnpApplyTextStyleAttributes () |
| ErrorCode | ToggleUnderline (ITextAttributeSuite *suite) |
| ErrorCode | CycleSmallAllCaps (ITextAttributeSuite *suite) |
| ErrorCode | ApplyFontVariant (ITextAttributeSuite *suite, const PMString &typeStyle) |
| ErrorCode | ToggleBold (ITextAttributeSuite *suite) |
| ErrorCode | ToggleItalic (ITextAttributeSuite *suite) |
| ErrorCode | ApplyAlignment (ITextAttributeSuite *suite, const ICompositionStyle::TextAlignment alignment) |
| const UID | CreateSDKStyleGroup (IDocument *document, IStyleGroupManager *styleGroupMgr) |
| ErrorCode | CreateParaStyle (ITextAttributeSuite *suite, const PMString &styleName, IDocument *document) |
| ErrorCode | ApplyParaStyle (ITextAttributeSuite *suite, const PMString &styleName, IDocument *document) |
| ErrorCode | CreateCharStyle (ITextAttributeSuite *suite, const PMString &styleName, IDocument *document) |
| ErrorCode | ApplyCharStyle (ITextAttributeSuite *suite, const PMString &styleName, IDocument *document) |
| ErrorCode | IncrementalCharRotation (ITextAttributeSuite *suite, const PMReal angle) |
| ErrorCode | ApplyTsume (ITextAttributeSuite *suite, const PMReal tsume) |
| ErrorCode | ApplyMojikumiSpacing (ITextAttributeSuite *suite, const PMReal space, const bool16 isBefore=kTrue) |
| ErrorCode | ApplyJidori (ITextAttributeSuite *suite, const int16 jidori) |
| ErrorCode | ApplyShatai (ITextAttributeSuite *suite, const PMReal lens, const PMReal angle) |
| ErrorCode | SetSingleColumn (ITextModel *textModel, const RangeData &range) |
| ErrorCode | SetSpanColumns (ITextModel *textModel, const RangeData &range, int16 spanNumber) |
| ErrorCode | SetSplitColumns (ITextModel *textModel, const RangeData &range, int16 splitNumber, PMReal insideGutter, PMReal outsideGutter) |
| const UID | ResolveRGBColorSwatch (const PMString &swatchName, const PMReal rRed, const PMReal rGreen, const PMReal rBlue, IDocument *document) |
| ErrorCode | ToggleParaBorder (ITextAttributeSuite *suite) |
| ErrorCode | ToggleParaShading (ITextAttributeSuite *suite) |
| inline |
Constructor.
| inlinevirtual |
Destructor.
| ErrorCode SnpApplyTextStyleAttributes::ApplyAlignment | ( | ITextAttributeSuite * | suite, |
| const ICompositionStyle::TextAlignment | alignment | ||
| ) |
Alignment is applied by creating a "alignment" attribute applied to text. kTextAttrAlignBodyBoss and kTextAttrAlignLastBoss are obsolete, and have been replaced with kTextAttrAlignmentBoss.
| suite | The active ITextAttributeSuite for the current text selection. |
| alignment | The text alignment. |
| ErrorCode SnpApplyTextStyleAttributes::ApplyCharStyle | ( | ITextAttributeSuite * | suite, |
| const PMString & | styleName, | ||
| IDocument * | document | ||
| ) |
Looks up the character style in the corresponding style table. The name of the style is hardcoded. If the UID is found to be valid, the style is applied using the TextAttributeSuite.
| suite | The active ITextAttributeSuite for the current text selection. |
| styleName | PMSString for the character style name. |
| document | Active document. |
| ErrorCode SnpApplyTextStyleAttributes::ApplyFontVariant | ( | ITextAttributeSuite * | suite, |
| const PMString & | typeStyle | ||
| ) |
Applies the specified font face, by taking the name of the font variant (e.g., "Bold"), and then querying the text attribute suite to determine how many instances of the font variant exist.
| suite | The active ITextAttributeSuite for the current text selection. |
| typeStyle | PMString for the type face name. |
| ErrorCode SnpApplyTextStyleAttributes::ApplyJidori | ( | ITextAttributeSuite * | suite, |
| const int16 | jidori | ||
| ) |
InDesign Japanese Feature. Applies Jidori (effective EmBoxes to occupy) in the selected text. Jidori composes the selected characters in the specified number of character-widths.
| suite | The active ITextAttributeSuite for the current text selection. |
| jidori | Number of characters for jidori. |
| ErrorCode SnpApplyTextStyleAttributes::ApplyMojikumiSpacing | ( | ITextAttributeSuite * | suite, |
| const PMReal | space, | ||
| const bool16 | isBefore = kTrue | ||
| ) |
InDesign Japanese Feature. Inserts mojikumi space before or after the characters in the selected text. Default is "insert before".
| space | The percent of the mojikumi spacing. |
| isBefore | Flag indicating if we want to set the mojikumi spacing before or after. Default is "before"(kTrue). |
| ErrorCode SnpApplyTextStyleAttributes::ApplyParaStyle | ( | ITextAttributeSuite * | suite, |
| const PMString & | styleName, | ||
| IDocument * | document | ||
| ) |
Looks up the paragraph style in the corresponding style table. The name of the style is hardcoded. If the UID is found to be valid, the style is applied using the TextAttributeSuite.
| suite | The active ITextAttributeSuite for the current text selection. |
| styleName | PMSString for the paragraph style name. |
| document | Active document. |
| ErrorCode SnpApplyTextStyleAttributes::ApplyShatai | ( | ITextAttributeSuite * | suite, |
| const PMReal | lens, | ||
| const PMReal | angle | ||
| ) |
InDesign Japanese Feature. Apply shatai in the selected text. Shatai is not Italic, It is an optical effect applied by a lens. Shatai uses a lens magnification (Reduction rate) and an angle parameter.
| suite | The active ITextAttributeSuite for the current text selection. |
| lens | Lens magnification (Reduction rate). |
| angle | Shatai angle. |
| ErrorCode SnpApplyTextStyleAttributes::ApplyTsume | ( | ITextAttributeSuite * | suite, |
| const PMReal | tsume | ||
| ) |
InDesign Japanese Feature. Set the tsume value on the selected text.
| suite | The active ITextAttributeSuite for the current text selection. |
| tsume | The Moji-Tsume of the characters by the percent. |
| ErrorCode SnpApplyTextStyleAttributes::CreateCharStyle | ( | ITextAttributeSuite * | suite, |
| const PMString & | styleName, | ||
| IDocument * | document | ||
| ) |
Creates a character style with defaults, but blue. The character style table is first queried so that we can be sure the style is not already in the document – if it is, a log message will inform the user that the style has already been created and choose a different name. If the style does not exist, it is created.
| suite | The active ITextAttributeSuite for the current text selection. |
| styleName | PMSString for the character style name. |
| document | Active document. |
| ErrorCode SnpApplyTextStyleAttributes::CreateParaStyle | ( | ITextAttributeSuite * | suite, |
| const PMString & | styleName, | ||
| IDocument * | document | ||
| ) |
Creates a paragraph style with all the defaults, but 18 point font size. The paragraph style table is first queried so that we can be sure the style is not already in the document – if it is, a log message will inform the user that the style has already been created and choose a different name. If the style does not exist, it is created.
| suite | The active ITextAttributeSuite for the current text selection. |
| styleName | PMSString for the paragraph style name. |
| const UID SnpApplyTextStyleAttributes::CreateSDKStyleGroup | ( | IDocument * | document, |
| IStyleGroupManager * | styleGroupMgr | ||
| ) |
Create a SDK group to organize the styles created in this snippets, also to demo the new feature available in CS3
| document | We are creating the style as part of doc workspace, this is the doc associated with the style |
| styleGroupMgr | the doc's style group manager, could be either for char or para style, depends on how you query it. |
| ErrorCode SnpApplyTextStyleAttributes::CycleSmallAllCaps | ( | ITextAttributeSuite * | suite | ) |
Queries the TextAttributeSuite for the CapsMode attribute. Finding one instance of the normal/small/all caps attribute in the selected text range means that it may or may not be applied, and the mode must be queried to determine this. Finding multiple instances means that there is a mix of modes (part of the text is small/all caps, part is not).
| suite | The active ITextAttributeSuite for the current text selection. |
| ErrorCode SnpApplyTextStyleAttributes::IncrementalCharRotation | ( | ITextAttributeSuite * | suite, |
| const PMReal | angle | ||
| ) |
InDesign Japanese Feature. Incremental rotation to characters individually in the specified angle.
| suite | The active ITextAttributeSuite for the current text selection. |
| angle | Angle of character rotation. |
| const UID SnpApplyTextStyleAttributes::ResolveRGBColorSwatch | ( | const PMString & | swatchName, |
| const PMReal | rRed, | ||
| const PMReal | rGreen, | ||
| const PMReal | rBlue, | ||
| IDocument * | document | ||
| ) |
Finds or creates a color in the swatch list, returning a UID to the color. We use a color swatch for the character style.
| swatchName | Swatch Name |
| rRed | Red (0.0...1.0) |
| rGreen | Green (0.0...1.0) |
| rBlue | Blue (0.0...1.0) |
| document | Active document. |
| ErrorCode SnpApplyTextStyleAttributes::SetSingleColumn | ( | ITextModel * | textModel, |
| const RangeData & | range | ||
| ) |
For paragraphy layout, set single column.
| textModel | The text model for the current text selection. |
| range | The text range. |
| ErrorCode SnpApplyTextStyleAttributes::SetSpanColumns | ( | ITextModel * | textModel, |
| const RangeData & | range, | ||
| int16 | spanNumber | ||
| ) |
For paragraphy layout, set span columns.
| textModel | The text model for the current text selection. |
| range | The text range. |
| spanNumber | The number of the columns which need be spanned. |
| ErrorCode SnpApplyTextStyleAttributes::SetSplitColumns | ( | ITextModel * | textModel, |
| const RangeData & | range, | ||
| int16 | splitNumber, | ||
| PMReal | insideGutter, | ||
| PMReal | outsideGutter | ||
| ) |
For paragraphy layout, set split columns.
| textModel | The text model for the current text selection. |
| range | The text range. |
| splitNumber | The number of the sub-columns. |
| insideGutter | The inside gutter of split columns. |
| outsideGutter | The outside gutter of split columns. |
| ErrorCode SnpApplyTextStyleAttributes::ToggleBold | ( | ITextAttributeSuite * | suite | ) |
Toggles the Bold font style state.
| suite | The active ITextAttributeSuite for the current text selection. |
| ErrorCode SnpApplyTextStyleAttributes::ToggleItalic | ( | ITextAttributeSuite * | suite | ) |
Toggles the Italic font style state.
| suite | The active ITextAttributeSuite for the current text selection. |
| ErrorCode SnpApplyTextStyleAttributes::ToggleUnderline | ( | ITextAttributeSuite * | suite | ) |
Toggles the underline state.
| suite | The active ITextAttributeSuite for the current text selection. |