Closed VickiLanger closed 3 years ago
Can you share the directory structure for you heroku app when its deployed? I'm guessing '/assets/Nunito-Regular.ttf' is not the location of the font on so that is why it can't find the resource.
That would make sense. I'm not sure how to find the directory structure in Heroku. I have it automatically deploy from the production branch. So, I assumed it was just using what I gave it.
I tried it on my computer, ImageFont.truetype('/assets/Nunito-Regular.ttf', 40)
did not work, but ImageFont.truetype('assets/Nunito-Regular.ttf', 40)
did work (removed the beginning slash), so this might work.
Another thing that worked was having the complete path ImageFont.truetype('C:/users...../Nunito-Regular.ttf', 40)
.
One of these might work on heroku, if the first does not fix it this question would help you see the file structure, and you can see directories/files and see the full path that way.
I should've tested that. I really thought it was going to want that beginning slash. The font now works.
Glad it is working now! I suppose this issue can be closed then.
Describe the bug Posting of images was an added feature with #90 & #94. The image post great, but there are issues with the text. In
get_img_for_tweet.py
, the font is currently set toImageFont.load_default()
but it needs to use a file from theassets
folder.Expected behavior Use font from file from the
assets
folder.Should be able to do this, but Heroku is throwing errors. Not sure if my path isn't right or if it's something with Heroku
Screenshots If applicable, add screenshots to help explain your problem.
Don't forget to follow the bot on Twitter to see the hard work you put in.