def getContext(surface, tx=0, ty=0, zoom=0): ctx = cairo.Context(surface) ctx.set_antialias(cairo.ANTIALIAS_NONE) ctx.set_line_join(cairo.LINE_JOIN_BEVEL) return ctx