#NEWLINE# def _processLookups( self , glyphRecords , lookups , processingAalt = False , logger = None ) : #NEWLINE# #INDENT# aaltHolding = [ ] #NEWLINE# boundarySensitive = set ( [ 'init' , 'medi' , 'fina' , 'isol' ] ) #NEWLINE# for ( featureTag , lookup ) in lookups : #NEWLINE# #INDENT# if ( ( not processingAalt ) and ( featureTag == 'aalt' ) ) : #NEWLINE# #INDENT# aaltHolding . append ( ( featureTag , lookup ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# if logger : #NEWLINE# #INDENT# logger . logLookupStart ( self , featureTag , lookup ) #NEWLINE# #UNINDENT# processed = [ ] #NEWLINE# while glyphRecords : #NEWLINE# #INDENT# skip = False #NEWLINE# if ( featureTag in boundarySensitive ) : #NEWLINE# #INDENT# side1GlyphNames = ( [ r . getSide1GlyphNameWithUnicodeValue ( self . _cmap ) for r in processed ] + [ r . getSide1GlyphNameWithUnicodeValue ( self . _cmap ) for r in glyphRecords ] ) #NEWLINE# side2GlyphNames = ( [ r . getSide2GlyphNameWithUnicodeValue ( self . _cmap ) for r in processed ] + [ r . getSide2GlyphNameWithUnicodeValue ( self . _cmap ) for r in glyphRecords ] ) #NEWLINE# index = len ( processed ) #NEWLINE# wordBreakBefore = isWordBreakBefore ( side1GlyphNames , index , self . _cmap ) #NEWLINE# wordBreakAfter = isWordBreakAfter ( side2GlyphNames , index , self . _cmap ) #NEWLINE# #UNINDENT# if ( featureTag == 'init' ) : #NEWLINE# #INDENT# if ( ( not wordBreakBefore ) or wordBreakAfter ) : #NEWLINE# #INDENT# skip = True #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( featureTag == 'medi' ) : #NEWLINE# #INDENT# if ( wordBreakBefore or wordBreakAfter ) : #NEWLINE# #INDENT# skip = True #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( featureTag == 'fina' ) : #NEWLINE# #INDENT# if ( wordBreakBefore or ( not wordBreakAfter ) ) : #NEWLINE# #INDENT# skip = True #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( featureTag == 'isol' ) : #NEWLINE# #INDENT# if ( ( not wordBreakBefore ) or ( not wordBreakAfter ) ) : #NEWLINE# #INDENT# skip = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# performedAction = False #NEWLINE# if ( not skip ) : #NEWLINE# #INDENT# ( processed , glyphRecords , performedAction ) = self . _processLookup ( processed , glyphRecords , lookup , featureTag , logger = logger ) #NEWLINE# #UNINDENT# if ( not performedAction ) : #NEWLINE# #INDENT# processed . append ( self [ 0 ] ) #NEWLINE# glyphRecords = glyphRecords [ 1 : ] #NEWLINE# #UNINDENT# #UNINDENT# glyphRecords = processed #NEWLINE# if logger : #NEWLINE# #INDENT# logger . logLookupEnd ( ) #NEWLINE# #UNINDENT# #UNINDENT# if ( ( not processingAalt ) and aaltHolding ) : #NEWLINE# #INDENT# glyphRecords = self . _processLookups ( glyphRecords , aaltHolding , processingAalt = True , logger = logger ) #NEWLINE# #UNINDENT# return glyphRecords