From 6403e53a1fef9fd7dd8c77640d01bb8aaee09f91 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Fri, 1 Feb 2008 00:35:27 -0800 Subject: OS-X: Set fontpath in xinitrc to include system / user fonts. Additionally fixed font scaling issues (trac #52) --- xinitrc.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/xinitrc.cpp b/xinitrc.cpp index c24bcd0..e01b9e7 100644 --- a/xinitrc.cpp +++ b/xinitrc.cpp @@ -70,7 +70,27 @@ XCOMM This is the fallback case if nothing else is executed above #endif /* !defined(__SCO__) && !defined(__UNIXWARE__) */ #ifdef __APPLE__ + +if [ -x /usr/X11/bin/xset ] ; then + fontpath="/usr/X11/lib/X11/fonts/misc/,/usr/X11/lib/X11/fonts/TTF/,/usr/X11/lib/X11/fonts/OTF,/usr/X11/lib/X11/fonts/Type1/,/usr/X11/lib/X11/fonts/75dpi:unscaled/,/usr/X11/lib/X11/fonts/100dpi/:unscaled,/usr/X11/lib/X11/fonts/75dpi:unscaled/,/usr/X11/lib/X11/fonts/100dpi/:unscaled" + + if [ -d "$HOME/Library/Fonts" ] ; then + if [ ! -e $HOME/Library/Fonts/fonts.dir ] ; then + [ -x /usr/X11/bin/mkfontdir ] && mkfontdir $HOME/Library/Fonts + [ -x /usr/X11/bin/mkfontscale ] && mkfontscale $HOME/Library/Fonts + fi + [ -e $HOME/Library/Fonts/fonts.dir ] && fontpath="$fontpath,$HOME/Library/Fonts" + fi + + [ -e /Library/Fonts/fonts.dir ] && fontpath="$fontpath,/Library/Fonts" + [ -e /System/Library/Fonts/fonts.dir ] && fontpath="$fontpath,/System/Library/Fonts" + + /usr/X11/bin/xset fp= "$fontpath" + unset fontpath +fi + [ -x /usr/bin/quartz-wm ] && exec /usr/bin/quartz-wm + #endif TWM & -- cgit v1.2.3