> On 12/14/11 13:26, Ian MacArthur wrote:
> >>      #define BOLD_ON  "\e[1m"
> >>    #define BOLD_OFF "\e[0m"
> >>      const char *msg = BOLD_ON "Alert!" BOLD_OFF "\nYour 
> printer is on fire";
> > 
> > Ah, but I see <ESC>[1m and I think "Bold", <ESC>[0m and I 
> think "attributes off"...
> > Maybe that's just me...
> 
>       That's true -- technically I should have used:
> 
>               #define BOLD_OFF "\e[21m"
> 
>       ..but \e[0m is so much easier to remember to turn off 
> everything :P


Ah, we may be talking at crossed-purposes - I was not meaning to be
pedantic about your ESC sequences, rather I was saying that I spent so
long working with those sequences that (to me) they are just as readable
as html mark-up!

That said, and being pedantic after all, I'd caution against using
<ESC>[21m to turn bold off, as in my experience it wasn't all that
widely supported. (Though things may have got better since then, it was
a while ago!)

I found that the most portable option, if I wanted to toggle BOLD off,
was to use <ESC>[0m to turn off everything, then turn back on whatever
other attributes were set, since the "21m" sequence only seemed to work
on some devices, not on others...





SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to