A collection of useful functions for working with fonts.


Add extreme points to all glyphs in the font, if they are missing.

align_to_grid(font, (sizeX, sizeY))[source]

Align all points of all glyphs in the font to a grid with size (sizeX,sizeY).


Automatically set contour directions for all glyphs in the font.


Automatically set contour order for all glyphs in the font.


Automatically set contour order and direction for all glyphs in the font, in one go.

create_guides(font, guides_dict)[source]

Decompose all composed glyph in the font.


Delete all groups in the font.

font_name(family, style)[source]

Same as full_name(), but family and style names are separated by a hyphen instead of space.

full_name(family, style)[source]

Build the full name of the font from family and style names.

Names are separated by a space. If the style is Regular, use only the family name.


Return the full name of the font, usually family name + style name.


Return current glyph selection in the font as glyph names or RGlyph objects.


Return a dictionary containing the left and right spacing groups in the font.

mark_composed_glyphs(font, color='Orange', alpha=0.35)[source]

Mark all composed glyphs in the font.

move_glyphs(f, (delta_x, delta_y))[source]

Move all glyphs in the font by the given (x,y) distance.

parse_glyphs_groups(names, groups)[source]

Parse a gstring and a groups dict into a list of glyph names.

print_groups(font, mode=0)[source]

Print all groups and glyphs in the font.

print_selected_glyphs(f, mode=0, sort=False)[source]

Print the selected glyphs to the output window.


Remove overlaps in all glyphs of the font.

rename_glyph(font, old_name, new_name, overwrite=True, mark=True, verbose=True)[source]

Rename a glyph in a given font.

  • font (RFont) – The font which contains the glyph to be renamed.
  • old_name (str) – The old glyph name to be replaced.
  • new_name (str) – The new glyph name to be used in place of the old one.
  • overwrite (bool) – Overwrite existing glyph with the new name.
  • mark (bool) – Mark the glyph after renaming.
  • verbose (bool) – Output informative messages to the console.
rename_glyphs_from_list(font, names_list, overwrite=True, mark=True, verbose=True)[source]
round_to_grid(font, gridsize, glyphs=None)[source]
scale_glyphs(f, (factor_x, factor_y))[source]

Scale all glyphs in the font by the given (x,y) factor.

set_font_names(f, family_name, style_name)[source]

Set font names from family_name and style_name.

set_foundry_info(font, fontInfoDict)[source]

Set foundry info from data in dict.


Set random unique PostScript ID.


Return a temporary font for importing single .glyfs.

Previous topic


Next topic


This Page