From: Andi C. S. <ski...@ya...> - 2012-05-10 21:45:48
|
Hello, --- On Wed, 5/2/12, Araki Ken <ara...@us...> wrote: > From: Araki Ken <ara...@us...> > Subject: Re: [Mlterm-dev-en] 3.1.0 crash > To: ski...@ya..., mlt...@li... > Date: Wednesday, May 2, 2012, 4:49 PM > Hi, > > Thanks for your report. > > From: Andi Cristian Serbanescu <ski...@ya...> > Subject: Re: [Mlterm-dev-en] 3.1.0 crash > Date: Sat, 28 Apr 2012 14:15:33 -0700 (PDT) > Message-ID: <133...@we...> > > > To illustrate (having set bg_color = black, fg_color = > white, bd_color = hl_white and ul_color = cyan), BD and UL > appear as expected, but BD + UL is underlined hl_white on > black (i.e. ul_color/disable underline has no effect) > > Ummm... I think xterm (and urxvt) has the same behavior. > Mlterm should work the same way as xterm as much as > possible. > You are right. Xterm disables the underline for plain UL only (urxvt doesn't disable it at all). But xterm also has resources to completely disable drawing underlines and bold text (underLine and allowBoldFonts). Initially, I had something else in mind for bold text, but maybe this can still be done as an extra option: if bd_color is not set, it would see if fg_color and ul_color are aliased to one of the default dim colours (0-7) and, if so, would handle them as if they were ordinary (ANSI) coloured text (i.e. highlight them if BD and apply RV before BD (if BD + RV), so that on the screen you would see bright (8-15) text on a dim (0-7) background). What do you think about this? > > RV + anything else is black on white (plus the other > attributes), just as if bd_color and ul_color were not > defined (although they behave as expected when selected with > the mouse). > > Thanks. This is a bug. > An attached patch will fix this problem. > I applied the patch, but it doesn't work :( > Regards, > --- > Araki Ken > ara...@us... > > -----Inline Attachment Follows----- > > diff -r 6140560880da > mlterm/ml_color.h > --- a/mlterm/ml_color.h Mon Apr 30 > 20:55:14 2012 +0900 > +++ b/mlterm/ml_color.h Thu May 03 > 01:43:20 2012 +0900 > @@ -16,6 +16,7 @@ > #define IS_256_COLOR(color) (0x10 <= (color) > && (color) <= 0xff) > #define IS_VALID_COLOR_EXCEPT_FG_BG(color) > ((unsigned int)(color) < 0xff) > #define IS_VALID_COLOR(color) (0x0 <= > (color) && (color) < 0x100) > +#define IS_FG_BG_COLOR(color) ((color) >= > 0x100) > > > typedef enum ml_color > diff -r 6140560880da xwindow/x_draw_str.c > --- a/xwindow/x_draw_str.c Mon Apr 30 > 20:55:14 2012 +0900 > +++ b/xwindow/x_draw_str.c Thu May 03 > 01:43:20 2012 +0900 > @@ -21,7 +21,7 @@ > { > if( font & FONT_BOLD) > { > - if( fg_color == > ML_FG_COLOR && x_color_manager_adjust_bd_color( > color_man)) > + if( > IS_FG_BG_COLOR(fg_color) && > x_color_manager_adjust_bd_color( color_man)) > { > > return 1 ; > } > @@ -29,7 +29,7 @@ > > if( is_underlined) > { > - if( fg_color == > ML_FG_COLOR && x_color_manager_adjust_ul_color( > color_man)) > + if( > IS_FG_BG_COLOR(fg_color) && > x_color_manager_adjust_ul_color( color_man)) > { > > return 2 ; > } > Regards, Andi Șerbănescu |