diff --git a/inkycal/modules/inkycal_weather.py b/inkycal/modules/inkycal_weather.py index 25a102c..594c5f9 100644 --- a/inkycal/modules/inkycal_weather.py +++ b/inkycal/modules/inkycal_weather.py @@ -156,7 +156,7 @@ class Weather(inkycal_module): # Lookup-table for weather icons and weather codes weathericons = { '01d': '\uf00d', '02d': '\uf002', '03d': '\uf013', - '04d': '\uf012', '09d': '\uf01a ', '10d': '\uf019', + '04d': '\uf012', '09d': '\uf01a', '10d': '\uf019', '11d': '\uf01e', '13d': '\uf01b', '50d': '\uf014', '01n': '\uf02e', '02n': '\uf013', '03n': '\uf013', '04n': '\uf013', '09n': '\uf037', '10n': '\uf036', @@ -171,6 +171,19 @@ class Weather(inkycal_module): box_size = size of text-box -> (width,height) icon = icon-unicode, looks this up in weathericons dictionary """ + + icon_size_correction = { + '\uf00d': 10/60, '\uf02e': 51/150, '\uf019': 21/60, + '\uf01b': 21/60, '\uf0b5': 51/150, '\uf050': 25/60, + '\uf013': 51/150, '\uf002': 0, '\uf031': 29/100, + '\uf015': 21/60, '\uf01e': 52/150, '\uf056': 51/150, + '\uf053': 14/150, '\uf012': 51/150, '\uf01a': 51/150, + '\uf014': 51/150, '\uf037': 42/150, '\uf036': 42/150, + '\uf03b': 42/150, '\uf038': 42/150, '\uf023': 35/150, + '\uf07a': 35/150, '\uf051': 18/150, '\uf052': 18/150, + '\uf0aa': 0 + } + x,y = xy box_width, box_height = box_size text = icon @@ -191,7 +204,7 @@ class Weather(inkycal_module): # Align text to desired position x = int((box_width / 2) - (text_width / 2)) - y = int((box_height / 2) - (text_height / 2)) + y = int((box_height / 2) - (text_height / 2) - (icon_size_correction[icon]*size)/2) # Draw the text in the text-box draw = ImageDraw.Draw(image)