Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upstream_patches1 #7

Merged
merged 2 commits into from
Jun 28, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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