Hello,
I've given up on wx.lib.plot for my purposes for now, and I'm rendering my
graph myself. On Linux it's starting to look great, but I'm getting an error
on Windows about picking an invalid font.
I'm doing things like this
def DrawLabels(self, dc):
"""Draw all labels on the graph."""
size = self.GetClientSize()
font = dc.GetFont()
pointSize = font.GetPointSize()
# The graph title.
font.SetPointSize(pointSize*1.5)
dc.SetFont(font)
dc.DrawText(self.title, int(size.width*0.4), 10)
# The X and Y axes.
font.SetPointSize(pointSize)
dc.SetFont(font)
# X-axis
dc.DrawText(self.xaxisLabel, int(size.width*0.5),
self.bottomMargin+25)
# Y-axis
dc.DrawRotatedText(self.yaxisLabel,
self.leftMargin-35,
int(size.height*0.5),
90)
I assume that setting point size to values like 1/2 current and 1 1/2 current
are causing invalid fonts on windows. How can I do this portably, and correct
for fonts that don't exist?
Thanks,
Mike
···
--
Michael P. Soulier <msoulier@digitaltorque.ca>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein