Thursday, December 1, 2011

Optimize fonts and memory on Solaris 11 desktop

Solaris 11 was released on Nov. 9th, 2011, this is the result of 7 years of huge engineering efforts since Solaris 10. Although Solaris is mainly designed for servers nowadays, Solaris is also good for desktop usage: ZFS, timeslider, DTrace, etc. Solaris 11 comes with GNOME 2.30 which is a very stable version (I'm disappointed with GNOME 3 shell or Ubuntu Unity) and Nimbus theme (created by Sun) which is my favorite theme.
I made some changes to the default settings of Solaris 11 desktop to suit my needs. 

Fonts
The most important part for the user experience on the desktop might be fonts. Different people have difference preferences on fonts and the same font has different effects on various font-size and screen resolutions, therefore I need take some time to test different fonts and find the appropriate ones for my desktop. In the end, I chose the following fonts for my desktop screen (20.1", 1600x1200 LCD): "Nimbus Sans" for English font,  "WenQuanYi Micro Hei" for Chinese font. Below are the steps for setup:
Change  Desktop Appearance
Right click the desktop -> Desktop Appearance... -> Fonts, set the Application, Document, Desktop, Window title font to "Nimbus Sans", size "10" and set the Fixed width font to "Liberation Mono".  (Note: do not use Chinese fonts in Desktop Appearance, because some Chinese fonts at some sizes make "i" looks "l")
Install Chinese fonts.
Solaris 11's default Chinese font is "AR PL ShanHeiSun Uni" (文鼎PL細上海宋Uni),  which is a free, long history, high-quality font on Unix/Linux. But I want to use a more modern font.  Solaris 11 software repository include "WenQuanYi Zen Hei" font ( To view which fonts are available, open Package Manager -> System -> Fonts) , but I personally feel it does not fit my screen.  "WenQuanYi Micro Hei" is a better option.To install it:
  1. Download from here 
  2. Unpack the downloaded file
  3. mkdir -p ~/.fonts
  4. Copy the "wqy-microhei.ttc" file to ~/.fonts
  5. (optional) Run "fc-cache" in terminal.
  6. To verify: run "fc-list | grep WenQuanYi", you should see that.
Change the system fonts configuration
The "Sans-serif", "Serif" and "Monospace" fonts are mapped to the default system fonts in /etc/fonts, to customize it, I did:
  1. mkdir -p ~/.fonts.conf.d/
  2. cp /etc/fonts/conf.d/60-latin.conf ~/.fonts.conf.d/
  3. cp /etc/fonts/conf.d/65-nonlatin.conf ~/.fonts.conf.d/
  4. edit ~/.fonts.conf.d/60-latin.conf
    move Nimbus fonts to the front in each section so that "serif" maps to "Nimbus Roman No9 L", "sans-serif" maps to "Nimbus Sans L", and "monospace" maps to "Liberation Mono".
  5. edit ~/.fonts.conf.d/65-nonlatin.conf
    add "WenQuanYi Micro Hei" before "WenQuanYi Zen Hei" for both "serif" and "sans-serif",  and add "WenQuanYi Micro Hei Mono" before "AR PL ShanHeiSun Uni" for "monospace".
  6. To verify: run "fc-match sans", "fc-match monospace" and "fc-match serif" in terminal.

Memory
My x86 workstation has very limited memory, so I need to make changes to limit the unnecessary memory use. Here are options that you can do to save the memory:
  • Desktop Appearance -> Visual Effects, choose "None"
  • System -> Preferences -> File Management, disable "Preview"
  • System -> Preferences -> File Indexing, disable "indexing"
  • System -> Preferences -> Startup Applications, disable anything you don't want
  • Only keep the necessary Applets on your task bar
  • Check your and root cron jobs (sudo crontab -l), disable unnecessary jobs with "crontab -e"
  • Check the SMF services using "svcs" command, disable unnecessary services with "svcadm disable" command