(height, fontdict, missing)
return missing - success
Fix missing grapheme clusters by combining components.
Fix missing grapheme clusters by combining components.
Fix missing grapheme clusters by combining components .
def _combine_glyphs(height, fontdict, missing):
    """Fix missing grapheme clusters by combining components."""
    success = set()
    for cluster in missing:
        if cluster not in fontdict:
            # fully decompose the grapheme cluster
            decomposed = unicodedata.normalize('NFD', cluster)
            # try to combine grapheme clusters first
            if len(decomposed) > 1:
                # combine strings
                clusterglyph = bytearray(height)
                try:
                    for c in decomposed:
                        for y, row in enumerate(iterchar(fontdict[c])):
                            clusterglyph[y] |= ord(row)
                except KeyError as e:
                    logging.debug(
                        '%d-pixel font: Could not combine grapheme cluster %s, missing u+%04x [%s]',
                        height, cluster, ord(c), c
                    )
                fontdict[cluster] = bytes(clusterglyph)
                success.add(cluster)
    return missing - success
def _combine_glyphs ( height , fontdict , missing ) : success = set ( ) for cluster in missing : if cluster not in fontdict : # fully decompose the grapheme cluster decomposed = unicodedata . normalize ( 'NFD' , cluster ) # try to combine grapheme clusters first if len ( decomposed ) > 1 : # combine strings clusterglyph = bytearray ( height ) try : for c in decomposed : for y , row in enumerate ( iterchar ( fontdict [ c ] ) ) : clusterglyph [ y ] |= ord ( row ) except KeyError as e : logging . debug ( '%d-pixel font: Could not combine grapheme cluster %s, missing u+%04x [%s]' , height , cluster , ord ( c ) , c ) fontdict [ cluster ] = bytes ( clusterglyph ) success . add ( cluster ) return missing - success