Example #1
0
def generate_fontnames(fonts):
	bitmaps = []
	maxwidth = 0
	height = 0
	for item in fonts:
		bmp, size = wal.text_to_bitmap(item)
		bitmaps.append(bmp)
		maxwidth = max(size[0], maxwidth)
		height = size[1]
	return bitmaps, (maxwidth, height)
Example #2
0
def generate_fontname_cache(fonts):
	maxwidth = 0
	height = 0
	for item in fonts:
		try: bmp, size = wal.text_to_bitmap(item)
		except: continue
		FONTNAME_CACHE.append(bmp)
		maxwidth = max(size[0], maxwidth)
		height = size[1]
	MAXSIZE.append(maxwidth)
	MAXSIZE.append(height)
Example #3
0
def generate_fontname_cache(fonts):
    maxwidth = 0
    height = 0
    for item in fonts:
        try:
            bmp, size = wal.text_to_bitmap(item)
        except:
            continue
        FONTNAME_CACHE.append(bmp)
        maxwidth = max(size[0], maxwidth)
        height = size[1]
    MAXSIZE.append(maxwidth)
    MAXSIZE.append(height)
Example #4
0
def generate_fontname_cache(fonts):
    maxwidth = 0
    height = 0
    for item in fonts:
        try:
            bmp, size = wal.text_to_bitmap(item, wal.UI_COLORS['text'])
        except Exception as e:
            LOG.error('Cannot process font <%s> %s', item, e)
            continue
        FONTNAME_CACHE.append(bmp)
        maxwidth = max(size[0], maxwidth)
        height = size[1]
    MAXSIZE.append(maxwidth)
    MAXSIZE.append(height)