Since this gadget allows different text styles, you can supply an
import hook to parse the text correctly.
The default import hook understands the following escape sequences.
They may appear at any position within the line:
\33u
-
Set the soft style to underline.
\33b
-
Set the soft style to bold.
\33i
-
Set the soft style to italic.
\33n
-
Set the soft style back to normal.
\33h
-
Highlight the current line.
\33p[x]
-
Change to color
x
, where x
is taken from the colormap. 0 means normal.
The color is reset for each new line.
\33P[RRGGBB]
-
Change front color to the specified RGB color. The RGB color has to
be specified in the form of six hexadecimal digits RRGGBB. This is
only possible on true colour screens. The color is reset for each new line.
\33P[AARRGGBB]
-
Change front color to the specified RGB color and apply alpha blending
at the specified intensity. The RGB color has to be specified in the form
of six hexadecimal digits RRGGBB which have to be prefaced with two
alpha channel digits AA specifying the blending intensity. This is only
possible on true colour screens. The color is reset for each new line.
The following sequences are only valid at the beginning of a line.
If they are placed elsewhere, the result is undefined (they might
be ignored or not):
\33l
-
Left justify current and following lines.
\33r
-
Right justify current and following lines.
\33c
-
Center current and following lines.
\33[s:x]
-
Create a separator.
x
is a bit combination of flags:
Bit 0 set
-
Top placement of separator.
Bit 1 set
-
Middle placement of separator.
Bit 2 set
-
Bottom placement of separator.
Bit 3 set
-
Draw separator on top of text (strike through).
Bit 4 set
-
Make separator extra thick.
The following values may be passed to this attribute:
Plain
-
Use default import mode (see above).
MIME
-
This built-in hook will convert quoted-printables (e.g. "=E5") to
the ASCII representation, merge lines ending with a "=", wordwrap
the text (using the value set with TextEditor.ImportWrap),
highlight all lines that start with ">", make real *bold*, /italic/,
_underline_ and #colored# text, and replace <sb> or <tsb> with a real
separator bar. It will stop parsing upon reaching a
NULL
byte.
The color used for #colored# text is colormap entry 6, which defaults
to MPEN_FILL
. To override it, just supply a colormap with entry 6
set to whatever color you would like.
MIMEQuoted
-
Like the MIME import hook, but each line gets quoted and highlighted.
EMail
-
Like the MIME import hook, but it doesn't convert quoted printables.
Note, that the last three hooks also evaluate the escape sequences
described for the Plain
import hook type. While it never was documented
there are some programs insisting on this side effect of an old
implementation. Hence starting with version 51.13 this behaviour had
to be official supported.