示例#1
0
    def __init__(self, font=None, size=10, index=0, encoding="", file=None):
        # FIXME: use service provider instead
        if file:
            if warnings:
                warnings.warn('file parameter deprecated, please use font parameter instead.', DeprecationWarning)
            font = file

        if isPath(font):
            self.font = core.getfont(font, size, index, encoding)
        else:
            self.font_bytes = font.read()
            self.font = core.getfont("", size, index, encoding, self.font_bytes)
示例#2
0
    def __init__(self, font=None, size=10, index=0, encoding="", file=None):
        # FIXME: use service provider instead
        if file:
            if warnings:
                warnings.warn('file parameter deprecated, please use font parameter instead.', DeprecationWarning)
            font = file

        if isPath(font):
            self.font = core.getfont(font, size, index, encoding)
        else:
            self.font_bytes = font.read()
            self.font = core.getfont("", size, index, encoding, self.font_bytes)
示例#3
0
文件: ImageFont.py 项目: Ddfulton/SDE
    def __init__(self, font=None, size=10, index=0, encoding=""):
        # FIXME: use service provider instead

        self.path = font
        self.size = size
        self.index = index
        self.encoding = encoding

        if isPath(font):
            self.font = core.getfont(font, size, index, encoding)
        else:
            self.font_bytes = font.read()
            self.font = core.getfont(
                "", size, index, encoding, self.font_bytes)
示例#4
0
    def __init__(self, font=None, size=10, index=0, encoding=""):
        # FIXME: use service provider instead

        self.path = font
        self.size = size
        self.index = index
        self.encoding = encoding

        if isPath(font):
            self.font = core.getfont(font, size, index, encoding)
        else:
            self.font_bytes = font.read()
            self.font = core.getfont("", size, index, encoding,
                                     self.font_bytes)