def _getFont(self, size):
"""Take font size, adjusts if printing and returns wx.Font"""
s = size * self.printerScale * self._fontScale
of = self.GetFont()
# Linux speed up to get font from cache rather than X font server
key = (int(s), of.GetFamily(), of.GetStyle(), of.GetWeight())
font = self._fontCache.get(key, None)
if font:
return font # yeah! cache hit
else:
font = wx.Font(
int(s), of.GetFamily(), of.GetStyle(), of.GetWeight())
self._fontCache[key] = font
return font
评论列表
文章目录