#NEWLINE# def xhtml( self , text , width = None , height = None , style = None ) : #NEWLINE# #INDENT# layout = Layout ( ) #NEWLINE# if ( style is None ) : #NEWLINE# #INDENT# style = self . stylesheet #NEWLINE# #UNINDENT# layout . set_xhtml ( ( '<?xml version="1.0"?>\n            <html><head><style>%s</style></head>\n            <body>%s</body></html>' % ( style , text ) ) ) #NEWLINE# layout . viewport_x = 0 #NEWLINE# layout . viewport_y = 0 #NEWLINE# layout . viewport_width = ( width or 256 ) #NEWLINE# layout . viewport_height = ( height or 200 ) #NEWLINE# h = int ( layout . view . canvas_height ) #NEWLINE# w = int ( layout . view . canvas_width ) #NEWLINE# layout . viewport_width = w #NEWLINE# layout . viewport_height = h #NEWLINE# return layout