Changeset 1102

Show
Ignore:
Timestamp:
12/11/06 05:42:42 (2 years ago)
Author:
arjanmol
Message:

fixed bug in util.py

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphas/trunk/gaphas/util.py

    r1090 r1102  
    3434    text_align(cr, x, y, text, align_x=0, align_y=0) 
    3535 
     36 
    3637def text_align(cr, x, y, text, align_x=0, align_y=0, padding_x=0, padding_y=0): 
    3738    """ 
     
    6465    cr.show_text(text) 
    6566 
     67 
    6668def text_multiline(cr, x, y, text, padding=1): 
    6769    """ 
     
    7678    #cr.move_to(x, y) 
    7779    for line in text.split('\n'): 
    78         x_bear, y_bear, w, h, x_adv, y_adv = cr.text_extents(text) 
     80        print 'line', line 
     81        x_bear, y_bear, w, h, x_adv, y_adv = cr.text_extents(line) 
    7982        cr.move_to(x, y) 
    8083        cr.show_text(line) 
     84        cr.stroke() 
    8185        y += h + padding 
    8286 
     87 
    8388def text_set_font(cr, font): 
    84     """Set the font from a string. E.g. 'sans 10' or 'sans italic bold 12' 
     89    """ 
     90    Set the font from a string. E.g. 'sans 10' or 'sans italic bold 12' 
    8591    only restriction is that the font name should be the first option and 
    8692    the font size as last argument 
     
    96102 
    97103def path_ellipse (cr, x, y, width, height, angle=0): 
    98     """Draw an ellipse. 
     104    """ 
     105    Draw an ellipse. 
    99106    x      - center x 
    100107    y      - center y