lundi 4 mai 2015

التسميات:

Ubuntu like Debian Font Rendering using Infinality Font

In this guide we are going to see the steps to improve Debian font rendering and get Ubuntu like font rendering using Infinality font. I’m not going to add any before/after screenshots as the font rendering will differ from display to display based on the resolution, the pixel density etc.
Before we proceed, I would like to let you know that installing packages by adding PPA is not the way things are done usually in Debian.
But in this case, this is the easiest way to do it as these packages does not have any dependencies.

First let add the infinality font repository from launchpad.
sudo nano /etc/apt/sources.list
#Infinality Fonts
deb http://ppa.launchpad.net/no1wantdthisname/ppa/ubuntu trusty main
deb-src http://ppa.launchpad.net/no1wantdthisname/ppa/ubuntu trusty main

First we have to add keys to access the repository. To do that, we have to run,
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E985B27B

Now lets update & install infinality font.
sudo apt-get update
sudo apt-get install fontconfig-infinality


To configure infinality font, follow these steps
cd /etc/fonts/infinality/
sudo bash infctl.sh setstyle
Select a style:
1) debug 3) linux 5) osx2 7) win98
2) infinality 4) osx 6) win7 8) winxp
#?
I chose 3 (i.e. linux).

Now lets change the font style.
sudo vi /etc/profile.d/infinality-settings.sh
#################################################################
########################### EXAMPLES ############################
#################################################################
#
# Set the USE_STYLE variable below to try each example.
# Make sure to set your style in /etc/fonts/infinality.conf too.
#
# Possible options:
#
# DEFAULT – Use above settings. A compromise that should please most people.
# OSX – Simulate OSX rendering
# IPAD – Simulate iPad rendering
# UBUNTU – Simulate Ubuntu rendering
# LINUX – Generic “Linux” style – no snapping or certain other tweaks
# WINDOWS – Simulate Windows rendering
# WINDOWS7 – Simulate Windows rendering with normal glyphs
# WINDOWS7LIGHT- Simulate Windows 7 rendering with lighter glyphs
# WINDOWS – Simulate Windows rendering
# VANILLA – Just subpixel hinting
# CUSTOM – Your own choice. See below
# —– Infinality styles —–
# CLASSIC – Infinality rendering circa 2010. No snapping.
# NUDGE – CLASSIC with lightly stem snapping and tweaks
# PUSH – CLASSIC with medium stem snapping and tweaks
# SHOVE – Full stem snapping and tweaks without sharpening
# SHARPENED – Full stem snapping, tweaks, and Windows-style sharpening
# INFINALITY – Settings I use
# DISABLED – Act as though running without the extra infinality enhancements (just subpixel hinting).
USE_STYLE=”UBUNTU”
Now search for “USE_STYLE” or scroll (around line 710) till you see the option to set the style.
Now change the value of USE_STYLE as per your preference & save the file. I’m using UBUNTU style in this example.

LCD Filter Setting

We need to set the LCD filter setting in our home directory using a file called “.Xresources“.
Method 1
  1. Create a new file and name it as “.Xresources“.
  2. Open the file (If you can’t see the file, then you need to change setting to show hidden files), add the following line, save & close the file
    • Xft.lcdfilter: lcddefault
Method 2
Run the following command
echo "Xft.lcdfilter: lcddefault" >> ~/.Xresources
Note: In my LCD display, font rendering look best with hinting set to slight. You may change this value “medium or full” as per your preference.

Xfce

Go to Settings -> Appearance.
  • Tick the checkbox to Enable anti-aliasing
  • Set Sub-pixel order to RGB
  • Set Hinting to Slight
Xfce4 Font Setting









Gnome

Gnome does not have options to configure font rendering methods. So you need to install gnome-tweak-tool which can be done by running the following command.
sudo apt-get install gnome-tweak-tool
Then change the settings
Open Gnome tweak tool and to fonts setting.
  • Set Antialiasing to RGB
  • Set Hinting to Slight

Logout & login back to see the new font rendering.

Check Font Rendering Settings

You can check the current font rendering settings by running the following command,
xrdb -query
On running the above command, you should see the following settings.
Xft.dpi: 96
Xft.hintstyle: hintslight
Xft.lcdfilter: lcddefault
Xft.rgba: rgb

1 commentaires:

  1. This worked beautifully, thank you! I was frustrated with the fonts on Deepin 15.2 and your guide worked like a charm

    RépondreSupprimer