How to enable font thumbnail previews in Nautilus on Mint 6

Write tutorials and howtos in here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

How to enable font thumbnail previews in Nautilus on Mint 6

Postby blendenzo on Tue Feb 24, 2009 1:32 am

When I upgraded from Mint 4 to Mint 6, one of the features I immediately missed was the font thumbnail previews in Nautilus and the gnome-font-viewer application for previewing fonts before installing. I finally decided to figure out how to get these back in Mint 6, and after a good deal of research I was able to make it work. Many thanks to Saisombun on the Ubuntu forums for helping me locate the correct files.

I used the gnome-font-viewer and gnome-thumbnail-font binaries from Hardy Heron. They are located in the Gnome Control Center 2.22 package which can be found here: http://packages.ubuntu.com/hardy/gnome-control-center
  1. First, download the Gnome Control Center 2.22 package. Do not install it. Instead, right click and open it with Archive Manager. Navigate to the data.tar.gz/usr/bin directory in the archive and extract gnome-font-viewer and gnome-thumbnail-font to a temporary location.
  2. Now move the two programs from their temporary location to your /usr/bin directory. You will need to use root user access to do this.
  3. To register ttf files to open with gnome-font-viewer in Nautilus, open a folder containing fonts (such as /usr/share/fonts), then right-click a ttf file and choose "Open with" or "Open with other application". Enter the custom command gnome-font-viewer and confirm.
  4. To enable thumbnail previews of ttf files in Nautilus, open a terminal from any directory (it doesn't matter which) and enter the following commands:
    Code: Select all
    gconftool-2 -t bool -s /desktop/gnome/thumbnailers/application@x-font-ttf/enable true

    gconftool-2 -t string -s /desktop/gnome/thumbnailers/application@x-font-ttf/command 'gnome-thumbnail-font --size %s %i %o'
    As far as I know, this cannot be done system wide. You have to do run these commands on a per-user basis.
That's it. If you did everything correctly, you should see preview thumbnails in Nautilus for all of your ttf files.

Notes:
  • The default thumbnail text is "Aa". You can change this if you like by adding the --text option to the gconf command. In the following command, I've changed it to use the text "AaZz" instead:
    Code: Select all
    gconftool-2 -t string -s /desktop/gnome/thumbnailers/application@x-font-ttf/command 'gnome-thumbnail-font --size %s --text AaZz  %i %o'
    If you change the command, you will need to delete your ~/.thumbnails directory to refresh any thumbnails you may have already generated.
  • If you already had another application associated with ttf files, but you would like to make gnome-font-viewer the default, open your ~/.local/share/applications/mimeapps.info file and find the line similar to this:
    Code: Select all
    application/x-font-ttf=userapp-gnome-font-viewer-CTP4PU.desktop;
    The "CTP4PU" part in my entry will probably be different in yours. Copy that line to the clipboard, then remove it from mimeapps.info and save the file. Open ~/.local/share/applications/defaults.list file and add it there, without the semi-colon at the end.
blendenzo
Level 1
Level 1
 
Posts: 16
Joined: Tue Jul 17, 2007 2:16 pm

Linux Mint is funded by ads and donations.
 

Re: How to enable font thumbnail previews in Nautilus on Mint 6

Postby merlwiz79 on Thu Feb 26, 2009 8:33 am

You should be able to set this system wide.
This should work but haven't tested for myself.
Code: Select all
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type bool --set /desktop/gnome/thumbnailers/application@x-font-ttf/enable true

sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/thumbnailers/application@x-font-ttf/command 'gnome-thumbnail-font --size %s %i %o'


Code: Select all
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/thumbnailers/application@x-font-ttf/command 'gnome-thumbnail-font --size %s --text AaZz  %i %o'
Log out and back in for them to load.

To make the font viewer system wide.
Run in terminal:
Code: Select all
gksu gedit /usr/share/applications/gnome-font-viewer-mime.desktop

Copy, paste and save this into the empty file:
Code: Select all
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=gnome-font-viewer
Name=gnome-font-viewer
Exec=/usr/bin/gnome-font-viewer
NoDisplay=true
MimeType=application/x-font-otf;application/x-font-pcf;application/x-font-ttf;application/x-font-type1;

Run in terminal:
Code: Select all
gksu gedit /etc/gnome/defaults.list

Copy, paste and add this to the bottom of the file:
Code: Select all
application/x-font-pcf=gnome-font-viewer-mime.desktop
application/x-font-ttf=gnome-font-viewer-mime.desktop
application/x-font-type1=gnome-font-viewer-mime.desktop
application/x-font-otf=gnome-font-viewer-mime.desktop


To make this work for XFCE CE just add this step.
run in terminal:
Code: Select all
gksu mousepad /usr/share/thumbnailers/gnome-thumbnail-font.desktop

Copy, paste and save this into the empty file:
Code: Select all
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=gnome-thumbnail-font
Name=gnome-thumbnail-font
Comment=Creates thumbnails for font files
TryExec=/usr/bin/gnome-thumbnail-font --size %s %i %o
Exec=/usr/bin/gnome-thumbnail-font --size %s --text AaZz  %i %o
MimeType=application/x-font-otf;application/x-font-pcf;application/x-font-ttf;application/x-font-type1;
User avatar
merlwiz79
Level 11
Level 11
 
Posts: 3637
Joined: Wed Apr 04, 2007 1:50 pm
Location: Here again :)


Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 7 guests