Gnats 5218: Font of Plot Legend Doesn't Export or Print.
Note: This is with RiverWare 6.2.3, Qt 4.6.3, Qwt 5.2.1 -- 8-20-2012 (pw).
gnats entry / internal link
Something in the Qwt 5.2.1 QwtPlotPrintFilter is NAILING the fonts we have set on the "Title" and "Legend" text components (but interestingly, not the Axis Scale or Axis Title text components). There is a possibly relevent comment suggesting this behavior in method QwtPlot::print() in Qwt source file: qwt_plot_print.cpp.
As a work-around, we have commandeered the QwtPlotPrintFilter's virtual 'font' method to re-retrieve the fonts which had been set on these textual plot components. Also, after printing or 'image exporting', we need to set (again) the configured fonts on the SlotPlot.
Note that there is a suggestion in the Qwt documentation that the QwtPlotPrintFilter class will be removed in Qwt version 6. Probably that's OK because this work-around in that class is needed to fix a problem in that same class.
------------------
Q3GUI/SlotPlot.hpp
Q3GUI/SlotPlot.cpp
------------------
New implementations for the 'font' filter virtual method for our two QwtPlotPrintFilter subclasses:
After calling QwtPlot::print() for both printing and image export operations, call SlotPlot::setPlotFonts() to recover (set, again) the configured fonts for the plot title, legends, and axes.
---