lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Underline implementation problem?


From: Mauro Baso
Subject: Underline implementation problem?
Date: Sat, 31 Mar 2007 17:11:17 +0200

Hi all,

I've found something strange (or at least so it seems to me) in
Underline implementation.

I was looking for a way to underline paragraphs with a different color
(different from font one)
and I found that Lout puts the underline code (ul) before (and not
after) the last underlined word.

I don't know if there's a reason, but I'm sure there is a side effect:
the underline bar will be but behind that word and not in front of
that.

This is a problem if the last word of the line contains descenders and
you use a different colour for the underline.

So this is the patch I propose (I don't know if it's correct at all,
but at this time it works):

z23.c from line 1333

{       Child(y, link);
        if( !is_definite(type(y)) && type(y) != LINK_DEST_NULL )
        {
          if( type(y) == UNDER_REC )   /* generate an underline now */
          { BackEnd->PrintUnderline(word_font(y),word_colour(y),
             word_texture(y), back(y, COLM), fwd(y, COLM), pg - xmk);
            link = PrevDown(link);     /* remove all trace of underlining */
            DisposeChild(Up(y));       /* in case we print this object again */
          }
          continue;
        }
        y = FixAndPrintObject(y, xmk, xb, xf, dim, NO_SUPPRESS, pg, count,
              &aback, &afwd);
}


should become

{       Child(y, link);
       if( !is_definite(type(y)) && type(y) != LINK_DEST_NULL ) continue;
        
       y = FixAndPrintObject(y, xmk, xb, xf, dim, NO_SUPPRESS, pg, count,
             &aback, &afwd);
        
       Child(y, PrevDown(link));        

       if( !is_definite(type(y)) && type(y) != LINK_DEST_NULL )
       {
         if( type(y) == UNDER_REC )   /* generate an underline now */
        { BackEnd->PrintUnderline(word_font(y),word_colour(y),
                     word_texture(y), back(y, COLM), fwd(y, COLM), pg - xmk);
          DisposeChild(Up(y));       /* in case we print this object again */
        }       
       }        
}


Bye all and thanks a lot, Mauro.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]