rangeset_set_style?

Tony Balinski ajbj at free.fr
Tue Aug 7 13:19:05 CEST 2007


Quoting Bert Wesarg <wesarg at informatik.uni-halle.de>:

> Hello all,
>
> I may have the need to set not only the color for a rangeset but the
> font style too. So I thought about a new function that can set a spec.
> style to a rangeset. Has somebody thought about this too? Is it possible?

It's bound to be possible, but you may have to do some heavy lifting. A
quick look shows that the only font stored in the widget is the plain one.
Style records provide the bold and/or italic fonts directly as the fonts to
use, so there is no simple table of fonts, accessible to the text widget,
telling you which is which.

I would recommend adding these as resources to the widget.

As for the actual style settings, you essentially have three states for
each of bold and italic: "on", "off" or "default" (leave what syntax
highlighting would do, if active, or leave plain), eg
    rangeset_set_bold("on"|"off"|"default")
    rangeset_set_italic("on"|"off"|"default")

I sometimes think it might be good to be able to set a rangeset's
foreground color too, or even allow underlining (both in highlight
styles and rangesets), but that might take things too far!

Tony


More information about the Discuss mailing list