glyphutils

A collection of functions for working with glyphs.

center_glyph(glyph)[source]

Center the glyph in its advance width, leaving leftMargin and rightMargin with equal values.

center_glyph_layers(g, layers, guides=True)[source]
center_layers(g, layer_names, (middle_x, middle_y))[source]
change_suffix(glyph, old_suffix, new_suffix=None)[source]

Return a new modified name for glyph, using new_suffix in place of old_suffix.

check_lib(glyph)[source]
clear_glyph_libs(glyph)[source]

Delete all libs in glyph.

clear_guides(glyph)[source]
deselect_points(glyph)[source]

Deselect any selected point in glyph.

draw_bounds(g, (x1, y1, x2, y2), (x3, y3))[source]
equalize_bcps(glyph)[source]

Equalize bcps from selected points in glyph.

get_bounds(g, layer_names)[source]
get_middle((lo_x, lo_y, hi_x, hi_y))[source]
has_suffix(glyph, suffix)[source]

Check if the name of glyph has the extension suffix, and returns True or False.

retract_bcps(glyph)[source]

Retract bcps from selected points in glyph.

round_anchors(glyph, (sizeX, sizeY))[source]

Round the position of all anchors in glyph to the gridsize (sizeX,sizeY).

round_bpoints(glyph, (sizeX, sizeY))[source]

Round the position of all bPoints in glyph to the gridsize (sizeX,sizeY).

round_margins(glyph, gridsize, left=True, right=True)[source]

Round left and/or right margins to multiples of gridsize.

round_points(glyph, (sizeX, sizeY))[source]

Round the position of all points in glyph to the gridsize (sizeX,sizeY).

round_width(glyph, gridsize)[source]

Round glyph.width to a multiple of gridsize.

select_points_x(glyph, linePos, side='left')[source]

Select all points in glyph to left/right of linePos(x).

select_points_y(glyph, linePos, side='top')[source]

Select all points in glyph above/below the linePos(y).

shift_selected_points_x(glyph, delta, anchors=False, bPoints=True)[source]

Shift the selected points in glyph horizontally by delta units.

shift_selected_points_y(glyph, delta, anchors=False, bPoints=True)[source]

Shift the selected points in glyph vertically by delta units.

Previous topic

ftp

Next topic

gstring

This Page