#NEWLINE# def bzs_to_glyph( bzs , glyph ) : #NEWLINE# #INDENT# coordinates = [ ] #NEWLINE# flags = [ ] #NEWLINE# endPtsOfContours = [ ] #NEWLINE# for sp in bzs : #NEWLINE# #INDENT# for i in range ( len ( sp ) ) : #NEWLINE# #INDENT# lastbz = sp [ ( i - 1 ) ] #NEWLINE# bz = sp [ i ] #NEWLINE# if ( ( len ( bz ) != 3 ) or ( len ( lastbz ) != 3 ) or ( lerppt ( 0.5 , lastbz [ 1 ] , bz [ 1 ] ) != bz [ 0 ] ) ) : #NEWLINE# #INDENT# coordinates . append ( pt_to_int ( bz [ 0 ] ) ) #NEWLINE# flags . append ( 1 ) #NEWLINE# #UNINDENT# if ( len ( bz ) == 3 ) : #NEWLINE# #INDENT# coordinates . append ( pt_to_int ( bz [ 1 ] ) ) #NEWLINE# flags . append ( 0 ) #NEWLINE# #UNINDENT# #UNINDENT# endPtsOfContours . append ( ( len ( coordinates ) - 1 ) ) #NEWLINE# #UNINDENT# glyph . coordinates = _g_l_y_f . GlyphCoordinates ( coordinates ) #NEWLINE# glyph . flags = sp #NEWLINE# glyph . endPtsOfContours = endPtsOfContours