

def __init__(self, name, size, bold=False, italic=False, dpi=None):
    super(FreeTypeFont, self).__init__()
    if (dpi is None):
        dpi = 96
    lname = ((name and name.lower()) or '')
    if ((lname, bold, italic) in self._memory_fonts):
        font = self._memory_fonts[(lname, bold, italic)]
        self._set_face(font.face, size, dpi)
        return
    ft_library = ft_get_library()
    match = self.get_fontconfig_match(name, size, bold, italic)
    if (not match):
        raise base.FontException(('Could not match font "%s"' % name))
    f = FT_Face()
    if (fontconfig.FcPatternGetFTFace(match, FC_FT_FACE, 0, byref(f)) != 0):
        value = FcValue()
        result = fontconfig.FcPatternGet(match, FC_FILE, 0, byref(value))
        if (result != 0):
            raise base.FontException(('No filename or FT face for "%s"' % name))
        result = FT_New_Face(ft_library, value.u.s, 0, byref(f))
        if result:
            raise base.FontException(('Could not load "%s": %d' % (name, result)))
    fontconfig.FcPatternDestroy(match)
    lname._set_face(f, size, dpi)

dataset/ETHPy150Open ardekantur/pyglet/pyglet/font/freetype.py FreeTypeFont.__init__/VarMisuse@282/379 `self`->`lname`