Skip to content

Commit

Permalink
Use get_font inside of update_fontsize(), so that it uses the cache f…
Browse files Browse the repository at this point in the history
…or repeated reloads of the same font. This fixed an issue I had with it crashing when repeatedly rendering the same cloud in a loop. This may also fix atizo/PyTagCloud#6
  • Loading branch information
justis committed Jun 21, 2012
1 parent b19d236 commit cec155b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pytagcloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ def rotate(self, angle):
self._update_mask()

def update_fontsize(self):
self.font = font.Font(os.path.join(FONT_DIR, self.font_spec['ttf']),
self.tag['size'])
self.font = get_font(self.font_spec, self.tag['size'])

def load_font(name):
for font in FONT_CACHE:
Expand Down

0 comments on commit cec155b

Please sign in to comment.