Difference in font sizes in screenshot created using GUI script vs pvbatch
If I execute the following script using paraview --script script.py
, I get a screenshot that matches what I see on the screen (first image).
If I execute using pvbatch script.py
, the text font is smaller and legend font is much larger (second image).
Possibly related: #21009 (closed), #21109 (closed), and #20217 (closed)
OS-X 11.6.1 M1 and ParaView-5.10.1
script.py
import paraview.simple as pvs
# Execute these:
# /Applications/ParaView-5.10.1.app/Contents/MacOS/paraview --script script.py
# /Applications/ParaView-5.10.1.app/Contents/bin/pvbatch script.py
try:
__file__
fname = 'pvbatch.png'
except:
fname = 'gui.png'
# Determine image resolution to use by executing in GUI and inspecting the metadata.
ImageResolution = [1368, 684]
#FontScaling = "Do not scale fonts"
FontScaling = "Scale fonts proportionally"
view = pvs.GetActiveViewOrCreate('RenderView')
text = pvs.Text(Text=fname)
pvs.Show(text)
sphere = pvs.Sphere()
pvs.Show(sphere)
display = pvs.GetDisplayProperties(sphere, view=view)
pvs.ColorBy(display, ('POINTS', 'Normals', 'Magnitude'))
display.SetScalarBarVisibility(view, True)
pvs.SaveScreenshot(fname, view, FontScaling=FontScaling, ImageResolution=ImageResolution)
Edited by Bob Weigel