Why not just get Mac OS and Sublime Text then? Well, I’m not a fan of Apple products, that’s why. I like the graphical part though so here is how to adopt some of it.
What is below was done on Linux Mint 17 with Cinnamon. This should be good for other Ubuntu flavors but, you know, be warned. This may crash your system.
First of all, better system fonts for your Linux. These are not included out of the box, probably due to licensing concerns. There are Windows and Mac OS ones.
Install Microsoft TrueType fonts
1 |
sudo apt-get install ttf-mscorefonts-installer |
That’s pretty much it.
Install Mac OS fonts
These are not available in package and have to be installed manually. Links to the archive are fickle so look up ‘mac_fonts.tar.gz’ in Google. The archive contains the following files:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
71320 trebucit.ttfs 111476 comicbd.ttfs 126364 comic.ttfs 233892 timesbi.ttfs 193760 Aquabase.ttfs 61484 LITHOGRL.TTFs 46068 AppleGaramond-LightItalic.ttfs 275744 Monaco_Linux.ttfs 65296 trebucbi.ttfs 174420 Aquabase-spanish-support.ttfs 154264 verdanai.ttfs 65100 trebuc.ttfs 46560 AppleGaramond-Italic.ttfs 105468 andalemo.ttfs 241972 timesi.ttfs 139584 georgiab.ttfs 142964 georgia.ttfs 205932 tahoma.ttfs 117028 ariblk.ttfs 297660 cour.ttfs 45724 AppleGaramond-BoldItalic.ttfs 326072 timesbd.ttfs 221756 arialbi.ttfs 273020 arial.ttfs 139640 verdana.ttfs 1129000 Lucida Grande.ttfs 306688 courbd.ttfs 156668 georgiai.ttfs 47824 AppleGaramond-Light.ttfs 158796 georgiaz.ttfs 115068 lucon.ttfs 47476 AppleGaramond.ttfs 1123660 Lucida Grande Bold.ttfs 856543 HardGothicNormal.ttfs 203032 tahomabd.ttfs 47264 AppleGaramond-Bold.ttfs 238088 couri.ttfs 153324 verdanaz.ttfs 136076 impact.ttfs 136032 verdanab.ttfs 228796 courbi.ttfs 284560 arialbd.ttfs 65300 trebucbd.ttfs 200684 ariali.ttfs 322824 times.ttfs |
Download the archive…
1 2 3 |
mkdir ~/fontinstall cd ~/fontinstall wget http://<somehere-on-the-internet>/mac_fonts.tar.gz |
…and extract it:
1 |
tar zxf mac_fonts.tar.gz |
Now copy all the fonts to where the system will look for them:
1 2 3 |
sudo mkdir /usr/share/fonts/truetype/macos/ sudo mv fonts/* /usr/share/fonts/truetype/macos/ rm -r ~/fontinstall |
and update system’s font cache
1 |
sudo fc-cache -f -v |
Install Infinality
The new fonts can be selected everywhere you like now but it’s not much use. They still will not be rendered perfectly. To address that we need Infinality.
1 2 3 4 |
sudo add-apt-repository ppa:no1wantdthisname/ppa sudo apt-get update sudo apt-get upgrade sudo apt-get install fontconfig-infinality |
Do not log out just yet
There is a kind of compatibility issue between Infinality and Cinnamon. If not addressed, Cinnamon fails to start. Fortunately it’s really easy to fix.
Move Infinality script from system to user profile.
1 |
sudo mv /etc/profile.d/infinality-settings.sh /etc/infinality-settings.sh |
Make it executable
1 |
sudo chmod a+rx /etc/infinality-settings.sh |
Using your favorite editor add this line to the end of your ~/.profile
1 |
. /etc/infinality-settings.sh |
Now log out and log back in. It all should look… different now.
Default settings are reasonable but can be tweaked to personal taste. There is a number of presets and an option to create new ones. Important thing is there are two ways to set the rendering style. Although setting names are similar, the results do differ.
Use this to choose rendering style
1 |
sudo bash /etc/fonts/infinality/infctl.sh setstyle |
In addition, to select a rendering preset, edit your /etc/infinality-settings.sh
file.
1 |
sudo -H gedit /etc/profile.d/infinality-settings.sh |
Look up line with USE_STYLE
parameter. It should be USE_STYLE="DEFAULT"
now. You will see a comment above with other available presets. Try these out until you find the best one for you. You will have to do the log out/in thing for changes to take effect.
Compare text rendered by Firefox under different combinations of settings.
win7
for setstyle and USE_STYLE="WINDOWS7"
in the config file is the winner.
Set up terminal font
In terminal of your choice select Monaco font of size 10. For the default Cinnamon’s GNOME Terminal follow the next steps.
Open current profile preferences dialog:
Clear ‘Use system fixed width font’ check box and select Monaco font with size 10:
Vim-specific configuration is very basic, provided that you don’t use a more complex color theme like solarized. The setting is only necessary if you use Vim in terminal. For most color schemes it’s sufficient to add this to your .vimrc
:
1 |
set t_Co=256 |
This enables 256 colors in supporting terminals. After that the code in your Vim should look very similar to the Sublime Text of the guy next to you.
You can see the osx2/OSX on the right is very smoothed out although some people may like that. For me the clear winner is win7/WINDOWS7 on the left.
That’s all, folks. Hope your Linux days become much happier with a clear and beautiful fonts all around.
Credits go to:
WEBUPD8 portal for setting up Infinality tutorial;
Danny Stieben for setting up mac and windows fonts on Linux tutorial;
SHA512 for figuring out workaround of Cinnamon startup issue;
Infinality for bringing beauty of fonts to Linux.
Stephen
Thanks so much for putting this guide together. I was ready to give up on Linux (again) because of the fuzzy font rendering that never came close to Windows’ crispness.
Nic Nilov
I hear you mate! Thanks for the comment.