#NEWLINE# def _write_tx_body( self , col_absolute , row_absolute , width , height , shape ) : #NEWLINE# #INDENT# attributes = [ ( 'wrap' , 'square' ) , ( 'rtlCol' , '0' ) ] #NEWLINE# if ( not shape . align [ 'defined' ] ) : #NEWLINE# #INDENT# attributes . append ( ( 'anchor' , 't' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'vertical' in shape . align ) : #NEWLINE# #INDENT# align = shape . align [ 'vertical' ] #NEWLINE# if ( align == 'top' ) : #NEWLINE# #INDENT# attributes . append ( ( 'anchor' , 't' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( align == 'middle' ) : #NEWLINE# #INDENT# attributes . append ( ( 'anchor' , 'ctr' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( align == 'bottom' ) : #NEWLINE# #INDENT# attributes . append ( ( 'anchor' , 'b' ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# attributes . append ( ( 'anchor' , 't' ) ) #NEWLINE# #UNINDENT# if ( 'horizontal' in shape . align ) : #NEWLINE# #INDENT# align = shape . align [ 'horizontal' ] #NEWLINE# if ( align == 'center' ) : #NEWLINE# #INDENT# attributes . append ( ( 'anchorCtr' , '1' ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# attributes . append ( ( 'anchorCtr' , '0' ) ) #NEWLINE# #UNINDENT# #UNINDENT# self . _xml_start_tag ( 'xdr:txBody' ) #NEWLINE# self . _xml_empty_tag ( 'a:bodyPr' , attributes ) #NEWLINE# self . _xml_empty_tag ( 'a:lstStyle' ) #NEWLINE# lines = shape . text . split ( '\n' ) #NEWLINE# font = shape . font #NEWLINE# style_attrs = Shape . _get_font_style_attributes ( font ) #NEWLINE# latin_attrs = Shape . _get_font_latin_attributes ( font ) #NEWLINE# style_attrs . insert ( 0 , ( 'lang' , font [ 'lang' ] ) ) #NEWLINE# for line in lines : #NEWLINE# #INDENT# self . _xml_start_tag ( 'a:p' ) #NEWLINE# if ( line == '' ) : #NEWLINE# #INDENT# self . _write_font_run ( font , style_attrs , latin_attrs , 'a:endParaRPr' ) #NEWLINE# self . _xml_end_tag ( 'a:p' ) #NEWLINE# continue #NEWLINE# #UNINDENT# self . _xml_start_tag ( 'a:r' ) #NEWLINE# self . _write_font_run ( font , style_attrs , latin_attrs , 'a:rPr' ) #NEWLINE# self . _xml_data_element ( 'a:t' , line ) #NEWLINE# self . _xml_end_tag ( 'a:r' ) #NEWLINE# self . _xml_end_tag ( 'a:p' ) #NEWLINE# #UNINDENT# self . _xml_end_tag ( 'xdr:txBody' )