コード例 #1
0
ファイル: __init__.py プロジェクト: DalavanCloud/glyphsLib
def load_to_ufos(file_or_path, include_instances=False, family_name=None,
                 propagate_anchors=True):
    """Load an unpacked .glyphs object to UFO objects."""

    if hasattr(file_or_path, 'read'):
        font = load(file_or_path)
    else:
        with open(file_or_path, 'r', encoding='utf-8') as ifile:
            font = load(ifile)
    logger.info('Loading to UFOs')
    return to_ufos(font, include_instances=include_instances,
                   family_name=family_name,
                   propagate_anchors=propagate_anchors)
コード例 #2
0
def load_to_ufos(file_or_path,
                 include_instances=False,
                 family_name=None,
                 debug=False):
    """Load an unpacked .glyphs object to UFO objects."""

    if hasattr(file_or_path, 'read'):
        data = load(file_or_path)
    else:
        with open(file_or_path, 'r', encoding='utf-8') as ifile:
            data = load(ifile)
    logger.info('Loading to UFOs')
    return to_ufos(data,
                   include_instances=include_instances,
                   family_name=family_name,
                   debug=debug)
コード例 #3
0
def load_to_ufos(
    file_or_path,
    include_instances=False,
    family_name=None,
    propagate_anchors=True,
    ufo_module=None,
):
    """Load an unpacked .glyphs object to UFO objects."""

    if hasattr(file_or_path, "read"):
        font = load(file_or_path)
    else:
        with open(file_or_path, "r", encoding="utf-8") as ifile:
            font = load(ifile)
    logger.info("Loading to UFOs")
    return to_ufos(
        font,
        include_instances=include_instances,
        family_name=family_name,
        propagate_anchors=propagate_anchors,
        ufo_module=ufo_module,
    )