def makeBitmap(self, gc, text): gc.SetFont(self._font) width, height = gc.GetTextExtent(text) bitmap = wx.EmptyBitmap(width + 2*WEEKDAY_PADDING, height) mdc = wx.MemoryDC(bitmap) mdc.SetFont(self._font) mdc.SetBackground(wx.BLACK_BRUSH) mdc.Clear() mdc.DrawText(text, 0, 0) mdc.SelectObject(wx.NullBitmap) gc.DrawBitmap(bitmap, 0, 0, *bitmap.GetSize()) # gc.DrawText works, gc.DrawBitmap doesn't #gc.DrawText(text, 0, 0) return bitmap