TTF vs ttf in linux

During a recent migration of a friends family laptop from Vista to linux, I discovered a curious problem.

Said friend had a bunch of add-on TTF fonts in Vista which they still wanted to be available to them in linux. No worries, I thought – I’ll just copy them out of the windows partition and put them in ~/.fonts and away they’ll go.

Or not, as it turned out.

Curiously, some were showing up in OpenOffice, and some weren’t. Several font cache updates, reboots and various google searches later, they still were not showing.

At that point I thought I’d better have a look in ~/.fonts to see if I could spot a pattern with ones that were appearing, and ones that were not.

Bingo! All the non-working ones had extensions of .TTF – while the working ones were lower case.

Right, I thought – there must be a whizbang bash command to fix that! Off to google for help again and I was able to construct this command:

for i in *.TTF; do mv “$i” “`basename $i .TTF`.ttf”; done

Voila! Now all the fonts showed correctly (after a restart of OpenOffice of course).

Capitalisation only makes a difference in a real operating system after all!