I added the DLLs to the python25 folder, which is specified in the
PATH. I still have the problem.
Yes, but is it the first dir in the PATH that has copies of those DLLs?
No. That first dir was C:/WINDOWS/System32. I tried that and it
created a crash, so I cut the DLLs from it. Ultimately, I'll want the
Cairo-based anti-aliasing to work on apps that I deliver to others, so
I would rather not have to have users put (or the app put) DLLs in
that directory nor have to worry about their PATH settings or muck
with anything on their computers; I want it antialiasing to just work.
Oddly, when I run the wxPython demo, Cairo works fine. How can this be?
Does it use the same function in wx.lib.wxcairo where your problem is
manifesting?
Yes, *but*... I had taken the code to show some text from line 70 of
the Cairo demo in the wxPython demo. Which is confusing, since when I
run that demo, there IS no text displayed, only three geometric
shapes. The demo's log window does actually mention an error, though
one I don't understand:
Debug: ..\..\src\msw\dc.cpp(2338): 'BitBlt' failed with error
0x00000057 (the parameter
is incorrect.).
However, I have a part-way solution now. I've now tried taking code
to show text from the Cairo_Snippets code in the demo. *That* is
mostly working, and uses a different function. This is what I have
now for the Render(self,dc) function from the previous sample:
def Render(self, dc):
cr = wx.lib.wxcairo.ContextFromDC(dc)
cr.select_font_face ("Sans", cairo.FONT_SLANT_NORMAL,
cairo.FONT_WEIGHT_NORMAL)
cairo.ANTIALIAS_SUBPIXEL
cr.set_antialias(True)
cr.set_font_size (65)
cr.move_to (100, 100)
cr.show_text ("Hello")
The difference in the two pieces of code is this:
NOT WORKING FOR ME: wx.lib.wxcairo.FontFaceFromFont(
wx.FFont(10, wx.SWISS, wx.FONTFLAG_BOLD))
WORKING FOR ME: cr.select_font_face ("Sans", cairo.FONT_SLANT_NORMAL,
cairo.FONT_WEIGHT_NORMAL)
My remaining problem, though, is I don't think it is anti-aliasing the
text. The word "Hello" does not look smoothed to me. And it looks
the same whether I include those antialias lines or not.
Am I applying the antialiasing correctly? I'm finding the API hard to
figure out, probably because I haven't seen an example anywhere that
applies antialiasing to text (or maybe I have and don't realize it).
Thanks,
Che