HackerShackOfficial / Smart-Mirror

Raspberry powered mirror which can display news, weather, calendar events
MIT License
908 stars 384 forks source link

Pixel Width #38

Open ertiming opened 7 years ago

ertiming commented 7 years ago

I'm curious how to fix this. I've tried adjusting the pad x and y but the text is somehow getting cut image1 image2

markferreira01 commented 7 years ago

If you haven't figured this out yet, try adding expand =1, fill=BOTH into some of the .pack() commands for weather and news. It worked for me.

bervin61 commented 6 years ago

If anyone is still running into this issue, I came up with a fix. You'll need to adjust the hard-coded values to fit your screen

For the forecast:

            forecast2 = weather_obj["hourly"]["summary"]
            start=0
            while len(forecast2[start:len(forecast2)])>40 and forecast2.count(' ',start+35):
                start=forecast2.find(' ',start+35)
                forecast2=forecast2[0:start]+'\n'+forecast2[start+1:len(forecast2)]

And for the News stories:

            for post in feed.entries[1:6]:
                title=post.title
                start=0
                while len(title[start:len(title)])>100 and title.count(' ',start+90):
                    start=title.find(' ',start+90)
                    title=title[0:start]+'\n'+title[start+1:len(title)]

                headline = NewsHeadline(self.headlinesContainer, title)
                headline.pack(side=TOP, anchor=W)