Skip to content

Commit

Permalink
If Windows use a different FONT_PATH
Browse files Browse the repository at this point in the history
Fixes amueller#42 so that the user does not have to manually edit FONT_PATH if they are on a Windows machine
  • Loading branch information
sedders123 committed Apr 30, 2015
1 parent 642b4b5 commit a06678d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wordcloud/wordcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import sys
import numpy as np
from operator import itemgetter
from platform import system

from PIL import Image
from PIL import ImageDraw
Expand All @@ -20,7 +21,10 @@

item1 = itemgetter(1)

FONT_PATH = os.environ.get("FONT_PATH", "/usr/share/fonts/truetype/droid/DroidSansMono.ttf")
if system() == "Windows":
FONT_PATH = r"C:\Windows\Fonts\consola.ttf"
else:
FONT_PATH = os.environ.get("FONT_PATH", "/usr/share/fonts/truetype/droid/DroidSansMono.ttf")
STOPWORDS = set([x.strip() for x in open(os.path.join(os.path.dirname(__file__),
'stopwords')).read().split('\n')])

Expand Down

0 comments on commit a06678d

Please sign in to comment.