Adding "high-light" annotation escape code

I have been using somewhat complicated Textbox annotations in graphs, and would like to emphasize certain local sections. Text color or bold font codes don't do what I would prefer. Would it be feasible to add an escape code that would highlight the local character-sized background of subsequent characters (until it is disabled)? Ideally the selected high-light color alpha could be set as well. This would be similar to the high-light editing feature on Adobe pdf text. I'm presently using IP8 on Windows 10.

Dare I ask ... Have you considered using LaTeX to create an image of the annotation that you then overlay on the graph?

In reply to by jjweimer

I am trying to simplify updating of the Textbox by liberal use of dynamic global variables \{ }, and I want to avoid further manipulation tasks. If you can convince me that LaTeX can be applied easily and automatically, I might consider it.

In reply to by s.r.chinn

s.r.chinn wrote:

I am trying to simplify updating of the Textbox by liberal use of dynamic global variables \{ }, and I want to avoid further manipulation tasks. If you can convince me that LaTeX can be applied easily and automatically, I might consider it.

Ha! There is a serious level of convincing for me to do no doubt.

First, I can only promise it will be 'easy' on macOS with LaTeXiT. Secondly, I cannot promise anything automatic. The use of dynamic variables kills it here.

In any case, I might wonder whether you could trick the system in this way:

* create an image that is an appropriately colored line appropriately sized (e.g. 2 characters wide by 14pt high)

* use \$PICT$ to insert the image before and after the region to be highlighted

Otherwise, I agree with the suggestion you made. A textbox has a /B flag for the entire line. We could use an equivalent \b(r,g,b) escape code to use in the text line.

In reply to by thomas_braun

Thanks all for the suggestion regarding TeX. I looked at the help links, but they seemed focused on equation and symbol formatting. Can you provide a basic building-block example of displaying a sequence of colorized blank (empty character) spaces? (I would prefer not to have to create a customized PICT for each high-lighted character string.)

In reply to by thomas_braun

Thanks, Thomas. That is an excellent suggestion. On an initial test with a multi-character text string, it appears that some fine tweaking may be required, possibly with restriction to a mono-spaced text font and/or the unicode block element description (e.g. U+2588). There are presently problems with text non-overlap and high-lighting gaps.

Addendum:

TextBox/C/N=text0/F=0 "\\F'Consolas'\\[0\\K(65535,65535,0)\\[1█████████████████\\]0\\K(0,0,0)\\X1abcd1234MMMnnnWoW"

This uses the full-block U+2588, with mono-spaced font. The end result looks good, but the process is labor intensive.

Addendum 2 (an actual example of manual post-editing an existing Textbox):

"Modify Annotation" GUI entry:

Output Optical Energy = \[0\K(65535,65535,0)\[1█████\K(0,0,0)\X1\{string1}

\{string1} is a dynamic global string variable with known 5-character numeric width. See the snipped picture of the actual graph textbox portion attached below

 

HighLightGraph.png (47.24 KB) TextboxElement.PNG (1.01 KB)

Couldn't you generate a global string with the correct number of boxes and refer to that in the textbox as well?

In reply to by thomas_braun

Yes, there are a lot of options.If generating the Annotation from within an Igor function I have written a small utility function that examines the length of a global string, generates the correct number of special characters, and combines them in a large annotation string. Even there, there are more general issues if the number of hi-lite boxes should be less than than the full string length. Unless WaveMetrics can add a special hi-lite escape code, using your basic technique will have to be adapted for each user's special demands. (lsrmvn/s.r.chinn)