Пример #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 isStringType(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=""):
        # 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)
Пример #3
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 isStringType(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, file, size, index=0, encoding=""):
     # FIXME: use service provider instead
     import _imagingft
     self.font = _imagingft.getfont(file, size, index, encoding)
Пример #5
0
 def __init__(self, file, size, index=0, encoding=""):
     # FIXME: use service provider instead
     import _imagingft
     self.font = _imagingft.getfont(file, size, index, encoding)
Пример #6
0
 def __init__(self, file, size, index=0, encoding=""):
     # FIXME: use service provider instead
     self.font = core.getfont(file, size, index, encoding)