def get_names_from_path(fontpath):
    _file = os.path.basename(fontpath)
    _file_name = os.path.splitext(_file)[0]
    try:
        family_name, style_name = _file_name.split('_')
    except ValueError:
        family_name, style_name = _file_name.split('-')
    style_name = get_parameters_from_style(style_name)
    style_name = ' '.join(style_name)
    return family_name, style_name
Parse underscore(or hyphen)-separated font file names into ``family`` and ``style`` names.
dataset/ETHPy150Open gferreira/hTools2/Lib/hTools2/modules/fileutils.py/get_names_from_path