PDA

View Full Version : HOWTO: Have All Your Windows Fonts in Ubuntu.



Rev. Nathan
December 22nd, 2005, 04:35 AM
Well, I had a giant tutorial going, but my computer crashed. So instead of making a giant tutorial explaining everything step-by-step, breaking down each action and command, I'm just going to post the bare minimum. Maybe later I'll edit it (or someone else), but until then, following this tutorial blindly should also work.

This is a tutorial teaching you how to retrieve all your fonts from your Windows partition, and having them in Ubuntu. It's pretty simple and quick, and you'll have all your favorite fonts! Hurray for Wingdings! :D

First, you need to mount your Windows partition (skip these steps you are already mounted). You should know if you've mounted this or not; if you can access your files from your Windows partition by clicking an icon on your desktop, you are in business. If not, open up Terminal and type in the following:


sudo mkdir /media/windows

This action will ask for a password, type it in. Once done, a new folder called 'windows' will be located at Places --> Computer --> Filesystem --> media.


sudo mount /dev/hda1 /media/windows/ -t ntfs -o nls=utf8,umask=0222
All this gibberish means that your windows partition is now mounted in /media/windows.

Next, we move our fonts from windows to ubuntu.

Start here if your windows partition is already mounted!

Because people may have already mounted windows and placed it under a different name, we are going to copy and paste the fonts from windows in Ubuntu, rather than just grab them from windows directly.

So, go to Places --> windows (below 'Computer') --> WINDOWS --> Fonts

And your fonts are right there! Press Ctrl+A to select them all, and then Ctrl+C to copy them.

Now, go to your desktop, right click and make a new folder called 'fonts'. Open the folder, and press Ctrl+V to paste the fonts in there.

Open up Terminal (if you closed it), and type in


cd Desktop/fonts

This will change the working directory to the directory you just made. Next,


sudo cp *.ttf *.TTF /usr/share/fonts/truetype/msttcorefonts/

This copies the folder's fonts to ubuntu's font list.

Your done! Go to System --> Preferences --> Font and check 'em!

You may now delete the fonts folder you made on your desktop; no longer needed.

Bonus: You may also need to rebuild your font cache, I do not know if this is needed.


sudo fc-cache -f -v
Resources:
Tahoma Font in Ubuntu (http://ubuntuforums.org/showthread.php?t=82318)
www.ubuntuguide.org
The ubuntu wiki

onesojourner
January 10th, 2006, 07:28 AM
this is great. for some reason it had never crossed my mind that I could use my windows fonts. I actually don't have a folder called msttcorefonts so I copied them to usr/share/fonts/truetype. worked fine that way.

galgoz
January 11th, 2006, 05:19 PM
when I type

sudo mount /dev/hda1 /media/windows/ -t ntfs -o nls=utf8,umask=0222

I get the error

mount: special device /dev/hda1 does not exist

any tips?

meborc
January 11th, 2006, 05:49 PM
sudo fdisk -l

then check if hda1 is the drive your windows ntfs partition is situated... if not, then change the code to hda2 or whatever

EDIT: ... but i don't know about the legal issues concerning copying ms fonts like this... :rolleyes:

Chris Tucker
January 11th, 2006, 05:54 PM
it depends on your partition order, replace hda1 with your windows partition (try the app cfdisk to find out whats where)

galgoz
January 12th, 2006, 04:03 AM
Found out the issue, it was sda1 as it is a sata drive.

audax321
January 12th, 2006, 07:36 AM
Also, if you don't want to install the fonts system-wide, you can install them for a specific user by changing:


sudo cp *.ttf *.TTF /usr/share/fonts/truetype/msttcorefonts/

to



mkdir /home/<USERNAME>/.fonts
cp *.ttf *.TTF /home/<USERNAME>/.fonts


Then just rebuilt the font-cache as mentioned above. :)

souled
January 12th, 2006, 08:04 AM
Thanks for this howto! Does Ubuntu support the fonts with the .fon extension also?

onesojourner
January 12th, 2006, 08:49 PM
Thanks for this howto! Does Ubuntu support the fonts with the .fon extension also?

I would like to know that too.

mathieujohnson
January 14th, 2006, 09:49 AM
would this trick work for downloadable fonts?
Its been more than 6 months that I don't have a windows install so no fonts to get but getting some fonts from the net is a possible solution.
would it work in the same way?

DimaIL
January 14th, 2006, 11:07 AM
nice! thanks!
I have a question: Why do i need to open a terminal for just copy some fonts? Why i can't do this with copy-paste?

Thanks again!
Dima.

kosmic
January 14th, 2006, 11:20 AM
You can do copy paste if you run Nautilus as Root

hubbadub
January 18th, 2006, 10:42 AM
Wow, awesome tutorial, thanks!

Ruskie
January 18th, 2006, 10:57 AM
would this trick work for downloadable fonts?
Its been more than 6 months that I don't have a windows install so no fonts to get but getting some fonts from the net is a possible solution.
would it work in the same way?

Sure, the point is: copy any font you want to use into that directory and rebuild the cache. :)

DimaIL
January 18th, 2006, 12:48 PM
You can do copy paste if you run Nautilus as Root
And How can i do it?

Thanks
Dima

Rev. Nathan
January 19th, 2006, 06:11 AM
And How can i do it?

Thanks
Dima
You can go to Applications --> System Tools --> Log In As Diffrent User, and do it from there. However, Automatix (see sticky at the top of this forum) comes with a script when you are right click any folder you are in and make it the root user browsing that folder, which is faster. As chose to just give the tutorial in the terminal as to not make someone so lost.

Rev. Nathan
January 19th, 2006, 06:14 AM
would this trick work for downloadable fonts?
Its been more than 6 months that I don't have a windows install so no fonts to get but getting some fonts from the net is a possible solution.
would it work in the same way?
Yes, I would safely assume that any .tff (whether capitalized or not) would work in Ubuntu. Also, gnome-look.org has a file called 6,760 fonts, if you just want to splurge.

Link (http://www.gnome-look.org/content/show.php?content=9883)

A comment advises that it slows down the KDE start up, however... if you are using Kubuntu.

Rev. Nathan
January 19th, 2006, 06:22 AM
Thanks for this howto! Does Ubuntu support the fonts with the .fon extension also?
I don't think it would hurt just to throw a .fon into the folder to see if it works. If it crashes you fonts or X or something, you can switch to another terminal (alt+F2, for example, the GUI is located on Alt+F7) and type:

sudo nano /usr/share/fonts/truetype/msttcorefonts/fontfilename.fon

Or whereever in the font folder you installed it, and whatever the name of the .fon file is. Also, I found this while looking for you answer on Google: Link (http://ubuntuforums.org/showthread.php?t=7135). It appears that someone made a nifty script that converts .fon to .bdf fonts? Which are compatible with Ubuntu? Maybe you want to try this one, first.

I'm sorry, I'm actually a newbie myself. I just made this tutorial from logic I had acertained from reading and re-reading font guides, and using common-logic as to how I could just get something from Windows onto Linux. You could use the same logic to, say, get all you wallpapers onto Linux. Or your documents.

jmcwb
January 19th, 2006, 01:53 PM
I didn't bother to copy the fonts from the WINDOWS/fonts directory to the desktop. All that I did was:

(in a sudo -s terminal)
cd /<mountpoint>/WINDOWS/fonts
mkdir /usr/share/fonts/truetype/msttcorefonts/
cp *.ttf *.TTF /usr/share/fonts/truetype/msttcorefonts/

encho
January 19th, 2006, 04:53 PM
Nice, but I could make two points here.
1. First of all, I think it would be more convenient if you were using symlink (if your win partition is auto mounted of course), this way you'll avoid duplicating fonts, but rather using one and same folder for win and ubuntu. When adding new font in ie linux, they will appear in windows as well and vice versa.
2. Rather than using global folder for fonts, it would be more convenient to use your home folder (localy installed fonts at .fonts, also could be symlinked to win folder or any additional lin users). Why? If you are upgrading your system from time to time (like myself :) ) you may want to keep your settings and home folder in separate partition. When reinstalling from scratch, u will still have your fonts & settings.
Hope this helps.

H.E. Pennypacker
September 20th, 2006, 08:54 PM
I copied over Micrsoft Sans Serif, but it has a problem with spaces. Whenever typing a space, some rectangle shows up. It can't handle spaces.

I'll use another font, but anyone know how to solve this problem?

By the way, I am not looking for alternatives. I only want Microsoft Sans Serif.