def _flatten_fontspec(fontspecs):
    """
    Flatten a list of fontspec elements into a mapping dict
    """
    fontspec_map = dict()
    for fontspec in fontspecs:
        fs_attrs = dict()
        fs_attrs['size'] = fontspec.get('size')
        fs_attrs['family'] = fontspec.get('family')
        fs_attrs['color'] = fontspec.get('color')
        fontspec_map[fontspec.get('id')] = fs_attrs

    return fontspec_map