import re


def angel_code(path_to_fnt):
    """
    Returns dict with relevant angel code data,
    which is retreived from a .fnt file.

    """
    def line_to_items(line):
        words = re.findall(r'(?:[^\s,"]|"(?:\\.|[^"])*")+', line)
        items = [w.split('=') if '=' in w else (w, "0") 
                 for w in words]
        return [(k, eval(v)) for k, v in items]

    ac = {"char":{}}
    with open(path_to_fnt, "r") as f:
        for l in f:
            (key, _), *data = line_to_items(l)
            if key == "char":
                (_, char_id), *rest = data
                ac["char"][char_id] = dict(rest)
            else:
                ac[key] = dict(data)
    
    return ac