Skip to content

Commit

Permalink
Merge pull request #7 from justis/upstream_patches1
Browse files Browse the repository at this point in the history
thanks for your additions
  • Loading branch information
Reto Aebersold committed Jun 28, 2012
2 parents 84f5e3d + cec155b commit 8361a4d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 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 Expand Up @@ -349,8 +348,11 @@ def create_tag_image(
fontname=fontname,
rectangular=rectangular)

image_surface = Surface((sizeRect.w, sizeRect.h), SRCALPHA, 32)
image_surface.fill(background)
if type(output) == pygame.Surface:
image_surface = output
else:
image_surface = Surface((sizeRect.w, sizeRect.h), SRCALPHA, 32)
image_surface.fill(background)
for tag in tag_store:
image_surface.blit(tag.image, tag.rect)
pygame.image.save(image_surface, output)
Expand Down

0 comments on commit 8361a4d

Please sign in to comment.