dv-anomaly / ttf-wps-fonts

Symbol fonts required by wps-office.
619 stars 141 forks source link

Adjust fonts directory based on distribution #2

Closed rakshith-ravi closed 7 years ago

rakshith-ravi commented 7 years ago

As of now, we are assuming that the fonts directory is at /usr/share/fonts. In the manual installation README, we say

"....This is usually /usr/share/fonts, otherwise consult your distribution's documentation..."

The install script also assumes the same. This might not always be the case. If anyone is up for taking the effort, we could perhaps find the fonts folder (through a command perhaps?) and automatically install it to the right folder.

Just a suggestion. Not sure if it's worth the effort.

If this does seem worth the effort, do let me know on how to go about it. I'd love to learn, figure it out and contribute

dv-anomaly commented 7 years ago

There is no environment variable that I'm aware of. Something like this would be a good start. Then you can use the variable FONT_PATH to test the directory already exists, if not create it, and start copying files.

HOME_FONT="$HOME/.fonts"
MOST_DISTROS="/usr/share/fonts"
RHL5="/usr/X11R6/lib/X11/fonts"
RHL6="/usr/X11R6/lib/X11/fonts"

if test -e $MOST_DISTROS ; then
        FONT_PATH=$MOST_DISTROS
elif test -e $RHL5 ; then
        FONT_PATH=$RHL5
elif test -e $RHL6 ; then
        FONT_PATH=$RHL6
else
        FONT_PATH=$HOME_FONT
fi

FONT_PATH=$FONT_PATH"/wps-fonts"
dv-anomaly commented 7 years ago

This has been fixed in the latest commit.

1cc13c48747d7977fa517d5cd80de76bfb53a18f