python-pptx icon indicating copy to clipboard operation
python-pptx copied to clipboard

added the linux font directories

Open hoopes opened this issue 7 years ago • 11 comments

by copying the pattern of mac/windowss font directories

hoopes avatar Jan 03 '19 02:01 hoopes

@scanny I lost the labels from the other PR. My apologies for the hassle, git and I are not simpatico sometimes. https://github.com/scanny/python-pptx/pull/159 . They were shortlist and text.

hoopes avatar Jan 03 '19 02:01 hoopes

@hoopes can you say a little about what Linux distros this is likely to work for? The documentation should probably mention.

scanny avatar Jan 03 '19 20:01 scanny

From: https://wiki.ubuntu.com/Fonts https://wiki.archlinux.org/index.php/fonts https://wiki.debian.org/Fonts https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s1-x-fonts https://docs.fedoraproject.org/en-US/quick-docs/adding-new-fonts-fedora/

I added the /usr/local/share/fonts and ~/.local/share/fonts based on those wiki pages.

hoopes avatar Jan 05 '19 00:01 hoopes

Could we please get this merged into master?

rikardbakkehaug avatar Sep 26 '19 07:09 rikardbakkehaug

I too would like to see this merged to master!

Follow up question: how does python-pptx currently load fonts on Linux systems? Does it just bundle some default fonts, or is it more nuanced than that?

cachemap avatar Jul 08 '20 16:07 cachemap

I need this as well for the MInt distro!

poolpoolpool avatar Jan 01 '21 23:01 poolpoolpool

Hey guys, do you plan to merge it anytime soon? Would be super useful.

martmiskowiec avatar Feb 22 '21 17:02 martmiskowiec

I would also appreciate if this was merged. Needed for Ubuntu.

philpinola1 avatar Jan 10 '22 17:01 philpinola1

Did fork according @hoopes solution, thanks! I just copied all fonts from C:\Windows\Fonts to ~/.fonts/. Now I'm able to use tf.fit_text() on linux :)

555Russich avatar Jul 23 '23 19:07 555Russich

One simple way to make this work currently is to pass the desired font file instead. Not the best way, but it works without having to depend on forks for now.

A nice improvement for this solution would be to be able to configure/pass possible paths containing font files. Look for the default locations is possible and raise exception if no folder/file is found.

Verhaeg avatar Feb 14 '24 02:02 Verhaeg