[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[debian-knoppix] Microsoft fonts and Knoppix



People who use openoffice sometimes need access
to Microsoft fonts, for example if they want to edit 
a file that was created under Microsoft Office.

It occured to me that these fonts could be borrowed
from the machine they are working on, via the 
attached script or a variant thereof.

The script has been tested under Windows 98, but
a single test on a Windows XP machine failed.
I did not have access to the machine and could
not find out what was wrong.

If this script is first corrected for any errors,
I think it could be useful as a service-menu item.

There are two options for use:

1)  Copy the MS fonts to $HOME/.fonts

    COPY=yes ./use-ms-fonts

2)  Make soft links (the default behavior)

    ./use-ms-fonts

Conrad

#!/bin/bash

rm -rf $HOME/.fonts

mkdir -p $HOME/.fonts
cd $HOME/.fonts

for PARTITION in $(egrep '(fat|ntfs)' /etc/fstab | awk '{print $2}')
do

	if [ -z "$(mount | grep $PARTITION)" ]; then
		mount $PARTITION
	else
		MOUNTED="yes"
	fi

	FONTDIR=$(find $PARTITION -maxdepth 2 -name fonts)

	if [ ! -z "$FONTDIR" ]; then

		if [ -z "$COPY" ]; then

			for f in $FONTDIR/*.ttf
			do
				ln -s $f $(basename $f)
			done
		else
			for f in $FONTDIR/*.ttf
			do
				cp -u $f $(basename $f)
			done
		fi

	fi

	if [ -z "$MOUNTED" ]; then
		umount $PARTITION
	fi

	unset MOUNTED

done


Reply to: