Skip to content

font issue with pygame #6

@rblakemesser

Description

@rblakemesser

This might not be a pytagcloud issue per se... but here goes.

I'm getting a IO error related to the font filenames. I assume it's a pygame problem:

Traceback (most recent call last):
File "/home/blake/Dropbox/2012.03_WorkCode/tagcloud.py", line 41, in
File "/usr/local/lib/python2.7/dist-packages/pytagcloud/init.py", line 344, in create_tag_image
File "/usr/local/lib/python2.7/dist-packages/pytagcloud/init.py", line 275, in _draw_cloud
File "/usr/local/lib/python2.7/dist-packages/pytagcloud/init.py", line 62, in init
IOError: unable to read font filename

When I run the example code off your site, it runs though without a problem. I just can't figure out for the life of me why my code, which uses the same font as the example, won't run.

Here's my code......

import csv
from pytagcloud import create_tag_image, make_tags
from pytagcloud.lang.counter import get_tag_counts

input_csv = csv.reader(open('sql_output.csv','rb'),delimiter="~")

....[some stuff here that creates a list of word frequency tuples from my csv data]

word_frequencies = []
for n,irecord in enumerate(sorted(word_freqs.items(), key=lambda item: item[1])):
word_frequencies.append(tuple([irecord[0],irecord[1]]))

tags = make_tags(word_frequencies, maxsize=120)

create_tag_image(tags, 'cloud_large2.png', size=(900, 600), fontname='Lobster')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions