#NEWLINE# def expand_font( src_font , distance , join = 1 , cap = 1 ) : #NEWLINE# #INDENT# dst_font = NewFont ( showUI = False ) #NEWLINE# for glyph_name in src_font . keys ( ) : #NEWLINE# #INDENT# src_glyph = src_font [ glyph_name ] #NEWLINE# dst_font . newGlyph ( glyph_name ) #NEWLINE# dst_glyph = dst_font [ glyph_name ] #NEWLINE# outline_pen = make_outline ( src_glyph , distance , join , cap ) #NEWLINE# outline_pen . drawPoints ( dst_glyph . getPointPen ( ) ) #NEWLINE# dst_glyph . width = src_glyph . width #NEWLINE# if len ( src_glyph . components ) : #NEWLINE# #INDENT# for component in dst_glyph . components : #NEWLINE# #INDENT# dst_glyph . appendComponent ( component . baseGlyph , component . offset , component . scale ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return dst_font