#NEWLINE# def draw_candidate( c , number , family , given , party , i , tl , br , box_gap ) : #NEWLINE# #INDENT# number = str ( number ) #NEWLINE# font = pdfmetrics . getFont ( FONT ) #NEWLINE# c . rect ( ( tl [ 0 ] + ( 1 * mm ) ) , ( ( ( tl [ 1 ] - ( 3 * mm ) ) - ( i * box_gap ) ) - ( ( i + 1 ) * BOX_SIZE ) ) , BOX_SIZE , BOX_SIZE ) #NEWLINE# width = font . stringWidth ( number , ( FONT_SIZE + 1.0 ) ) #NEWLINE# c . setFont ( FONT , ( FONT_SIZE + 1.0 ) ) #NEWLINE# c . drawCentredString ( ( ( tl [ 0 ] + ( 1.1 * mm ) ) + ( BOX_SIZE / 2.0 ) ) , ( ( ( ( tl [ 1 ] - ( 2.3 * mm ) ) - ( i * box_gap ) ) - ( ( i + 1 ) * BOX_SIZE ) ) + ( 1.5 * mm ) ) , number ) #NEWLINE# text = c . beginText ( ( ( tl [ 0 ] + ( 2 * mm ) ) + BOX_SIZE ) , ( ( ( ( tl [ 1 ] - ( 3 * mm ) ) - ( i * box_gap ) ) - ( i * BOX_SIZE ) ) - 4.5 ) ) #NEWLINE# text . setFont ( ( FONT + '-Bold' ) , CANDIDATE_FONT_SIZE , leading = ( 1.1 * CANDIDATE_FONT_SIZE ) ) #NEWLINE# text . textLine ( family ) #NEWLINE# draw_text ( given , text , FONT , CANDIDATE_FONT_SIZE , LABEL_WIDTH , leading = CANDIDATE_FONT_SIZE ) #NEWLINE# if party : #NEWLINE# #INDENT# draw_text ( party . upper ( ) , text , FONT , PARTY_FONT_SIZE , LABEL_WIDTH ) #NEWLINE# #UNINDENT# c . drawText ( text ) #NEWLINE# c . setFont ( FONT , FONT_SIZE )