Copy link to clipboard
Copied
Hi All
I need to apply adornment to selected text range (selection can be single line or multi line)
I checked with BasicTextAdornment but instead of applying adornment to selected text range it applies adornment to each char style text range (in our selection if I have 2 or more character style or overrides then it applies the adornment to each style range.)
I need to draw symbol [ at the start of selection and ] to the end of selection.
Regards,
Alam
I make some hook into HiddenText sample plugin to make it work for applying adornment between selected text range (single/multi-line) and frame selection.
Copy link to clipboard
Copied
Nothing wrong with multiple style ranges. Text adornments are output produced by the composer for storage within wax (rendered text). Consider them as objectized chance to draw, what you draw is up to you. In preparation (your factory code within the attribute) you can look around your actual composed text, consider the environment (left side, right side, within, also be prepared to encounter multiple chunks / bindings of your own data lumped into a single range, or even overlaps after inconsistent edits) and remember to draw accordingly - store the resulting information in an additional data object of the adornment. For example kTextAdornmentUnderlineBoss would store all data from underline related attributes as seen in the composition state, producing a kTextAdornmentUnderlineDataBoss . That "look around" process would depend on additional objects that is not demonstrated by the BTA example (e.g. hyperlink text source). Handling text adornment data at line wraps, or even across pages, was also left as exercise.
Note that the BTA example is very old, it predates the CS5 split between UI and model plug-in by roughly a decade. Nowadays the IgnoreTag in the .fr is a bad hack. For real world use move most of the plug-in into a model plug-in and only keep the action component in the UI.
Note also that the XML subsystem does not use text adornments, it uses a (page item) adornment and a draw event. I did not look which of them draws the brackets.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Help me to understand how IGlobalTextAdornment::draw function gets invoke when using IGLOBALTEXTADORNMENT in my fr
Copy link to clipboard
Copied
While InDesign occasionally uses the same interface with multiple IIDs, you should always watch out for a separate interface, in this case IGlobalTextAdornment. Use a good text editor independent from your particular IDE to search the SDK by file extension. That would lead you to the header and even examples such as the SpellPanel.
Copy link to clipboard
Copied
Change AddIn to Class solved my problem
Copy link to clipboard
Copied
I make some hook into HiddenText sample plugin to make it work for applying adornment between selected text range (single/multi-line) and frame selection.