tpaviot / oce

OpenCASCADE Community Edition (OCE): a community driven fork of the Open CASCADE library.
http://groups.google.com/group/oce-dev
GNU Lesser General Public License v2.1
808 stars 284 forks source link

Use fontconfig to enumerate fonts on linux. #714

Closed gebner closed 5 years ago

gebner commented 5 years ago

Right now on linux, Font_FontMgr only searches for fonts in the directories /system/fonts, /usr/share/fonts, and /usr/local/share/fonts. At least on NixOS, none of these directories exist and there is no standard directory where all fonts are stored. (Each font package has its own directory; /etc/fonts/fonts.conf contains an automatically generated list of all font directories.)

This PR adds support for the fontconfig library to Font_FontMgr; fontconfig is the de-facto standard to find fonts on linux. As a nice side-effect, also fonts installed in the user's home directory should be found now.

There is a new cmake option OCE_WITH_FONTCONFIG to disable fontconfig support.

tpaviot commented 5 years ago

Looks good, thx !