Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look for OSX and Linux fonts in common places (#370 fixes) #1054

Merged
merged 4 commits into from
Dec 31, 2014

Conversation

charleslaw
Copy link

Fix #370

@hugovk hugovk changed the title #370 fixes Look for OSX and Linux fonts in common places (#370 fixes) Dec 28, 2014
@hugovk
Copy link
Member

hugovk commented Dec 28, 2014

@charleslaw Please can you include test cases so this new code is covered?

https://coveralls.io/files/404711323#L242

Info on enabling Travis/Coveralls here: https://github.com/python-pillow/Pillow/blob/master/CONTRIBUTING.md

@charleslaw
Copy link
Author

Added some tests. Also it's worth nothing I ran this on osx 10.9.5 (mavericks) and ubuntu 14.04.

@wiredfool
Copy link
Member

Previously discussed in #682.

According to the freedesktop spec, XDG_DATA_DIRS should default to /usr/share. Adding that as a default would allow the linux case to work when XDG_DATA_DIRS is not set, such as a VM with no desktop installed.

wiredfool added a commit that referenced this pull request Dec 31, 2014
Look for OSX and Linux fonts in common places (fixes #370)
@wiredfool wiredfool merged commit 1aed192 into python-pillow:master Dec 31, 2014
@wiredfool
Copy link
Member

Thanks for putting this together.

@SmoothJM
Copy link

why I still got the error:
Traceback (most recent call last): File "od_predict.py", line 34, in <module> object_detection(sys.argv[1]) File "od_predict.py", line 26, in object_detection r_image,box_count,left, top, right, bottom = yolov3.detect_image(image) File "/home/capstone/Capstone_web/server/public/keras-yolo3-master/yolo.py", line 133, in detect_image size=np.floor(3e-2 * image.size[1] + 0.5).astype('int32')) File "/usr/local/lib/python3.6/dist-packages/PIL/ImageFont.py", line 642, in truetype return freetype(font) File "/usr/local/lib/python3.6/dist-packages/PIL/ImageFont.py", line 639, in freetype return FreeTypeFont(font, size, index, encoding, layout_engine) File "/usr/local/lib/python3.6/dist-packages/PIL/ImageFont.py", line 188, in __init__ font, size, index, encoding, layout_engine=layout_engine OSError: cannot open resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System font support for Linux/OSX
4 participants