vfbLib.ufo.builder.VfbToUfoBuilder

class vfbLib.ufo.builder.VfbToUfoBuilder(vfb: Vfb, minimal=False, base64=False, pshints=True, add_kerning_groups=False, move_groups=True)

Bases: object

__init__(vfb: Vfb, minimal=False, base64=False, pshints=True, add_kerning_groups=False, move_groups=True) None

Serialize the JSON structure to UFO(s)

Parameters:
  • vfb (Vfb) – The vfbLib.vfb.vfb.Vfb to convert to UFO

  • minimal (bool, optional) – Convert only data necessary to generate font. Defaults to False.

  • base64 (bool, optional) – Store lib data in base64 encoding. Defaults to False.

  • pshints (bool, optional) – Include PostScript hinting. Defaults to True.

  • add_kerning_groups (bool, optional) – Add kerning groups to features.fea. Defaults to False.

  • move_groups (bool, optional) – Move non-kerning groups from groups.plist to features.fea. Defaults to True.

Methods

__init__(vfb[, minimal, base64, pshints, ...])

Serialize the JSON structure to UFO(s)

add_axis_mappings(data)

add_ot_class(data)

assure_tt_glyphlib()

assure_tt_lib()

build()

build_mm_glyph(data)

build_tt_glyph_lib()

build_tt_stems_lib()

build_tt_zones_lib()

get_designspace(out_path)

Build and return a DesignSpaceDocument.

get_master_info([master_index])

get_master_path(out_path, master_index)

get_ufo_master(index[, silent])

get_ufo_masters([silent])

get_ufos_designspace(out_path[, silent])

Build UFOs and a DesignSpaceDocument from the VFB contents in memory and return them.

set_feature_code(data)

set_glyph_background(data)

set_tt_code_stop(data)

set_tt_pixel_snap(data)

set_tt_stem_ppms(data)

Set the TT stem PPMs for stem widths of 2 to 5 pixels.

set_tt_stem_ppms_1(data)

Set the TT stem PPMs for stem width of 1 pixel.

set_tt_stems(data)

set_tt_zone_deltas(data)

set_tt_zone_stop(data)

set_tt_zones(data)

write(out_path[, overwrite, silent, ufoz])

Write a the VFB contents to master UFOs and a designspace file.

get_designspace(out_path: Path) DesignSpaceDocument

Build and return a DesignSpaceDocument. The out_path argument will be used to construct the UFO paths assigned to the source descriptors.

get_ufos_designspace(out_path: Path, silent=False) tuple[list[Font], DesignSpaceDocument | None]

Build UFOs and a DesignSpaceDocument from the VFB contents in memory and return them. The DesignSpaceDocument is only returned for VFBs containing more than one master. In other cases, the second element of the returned tuple is None.

set_tt_stem_ppms(data: TUfoStemPPMsDict) None

Set the TT stem PPMs for stem widths of 2 to 5 pixels.

Parameters:

data (TUfoStemPPMsDict) – The raw data.

set_tt_stem_ppms_1(data: TUfoStemPPMsDict) None

Set the TT stem PPMs for stem width of 1 pixel.

Parameters:

data (TUfoStemPPMDict) – The raw data.

write(out_path: Path, overwrite=False, silent=False, ufoz=False) None

Write a the VFB contents to master UFOs and a designspace file. The designspace file is only written if the VFB contains more than one master.