[Paraview] Python: Size of Text?

Kent Eschenberg eschenbe at psc.edu
Thu Apr 17 14:38:18 EDT 2008


Is there a way to determine the size of a TextSource? I'd like to center it but need to first know its size. For example, to center the text at (x,y):

  T = servermanager.sources.TextSource()
  T.Text = "Center Me!"
  TR = servermanager.CreateRepresentation( T, view,\
      proxyName="TextSourceRepresentation" )
  TR.ScaledText = 0
  TR.Justification = 1
  TR.Bold = 1
  TR.FontSize = 36
  (width,height) = TR.????()
  TR.Position = [ x-0.5*width, y-0.5*height ]

Kent
Pittsburgh Supercomputing Center


More information about the ParaView mailing list