(codepage_dict, font_families)
return uc_fonts
Load font typefaces.
Load font typefaces.
Load font typefaces .
def read_fonts(codepage_dict, font_families):
    """Load font typefaces."""
    # default font is fallback
    font_families = list(font_families) + [_DEFAULT_NAME]
    # load the graphics fonts, including the 8-pixel RAM font
    # use set() for speed - lookup is O(1) rather than O(n) for list
    unicode_needed = set(itervalues(codepage_dict))
    # break up any grapheme clusters and add components to set of needed glyphs
    unicode_needed |= set(c for cluster in unicode_needed if len(cluster) > 1 for c in cluster)
    # load font resources
    font_files = {
        _height: [
            _font for _font in
            (_get_font(_name, _height) for _name in font_families)
            if _font is not None
        ]
        for _height in _HEIGHTS
    }
    # convert
    uc_fonts = {
        _height: load_hex(_font_file, _height, unicode_needed)
        for _height, _font_file in iteritems(font_files)
        if _font_file
    }
    return uc_fonts
def read_fonts ( codepage_dict , font_families ) : # default font is fallback font_families = list ( font_families ) + [ _DEFAULT_NAME ] # load the graphics fonts, including the 8-pixel RAM font # use set() for speed - lookup is O(1) rather than O(n) for list unicode_needed = set ( itervalues ( codepage_dict ) ) # break up any grapheme clusters and add components to set of needed glyphs unicode_needed |= set ( c for cluster in unicode_needed if len ( cluster ) > 1 for c in cluster ) # load font resources font_files = { _height : [ _font for _font in ( _get_font ( _name , _height ) for _name in font_families ) if _font is not None ] for _height in _HEIGHTS } # convert uc_fonts = { _height : load_hex ( _font_file , _height , unicode_needed ) for _height , _font_file in iteritems ( font_files ) if _font_file } return uc_fonts