def METHOD_NAME(font_context, filename, autocreate=True, family=None):
    if not autocreate and not PangoFontContextManager.exists(font_context):
        raise Exception("FontContextManager: Attempt to add font file "
                        "'{}' to non-existing context '{}' without "
                        "autocreate.".format(filename, font_context))
    if not filename:
        raise Exception("FontContextManager: Cannot add empty font file")
    if not isfile(filename):
        filename = resource_find(filename)
    if not isfile(filename):
        if not filename.endswith('.ttf'):
            filename = resource_find('{}.ttf'.format(filename))
    if filename and isfile(filename):
        return kpango_font_context_add_font(font_context, filename)
    raise Exception("FontContextManager: Attempt to add non-existent "
                    "font file: '{}' to context '{}'"
                    .format(filename, font_context))