Difference between revisions of "Fonts"

m (more details)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Install the packages ==
+
== Console Only Fonts ==
Linux font quality is a chronic issue, by default fonts configuration far from ideal look. This can solved by rebuilding <tt>media-libs/fontconfig</tt> with infinality USE flag, which applying infinality patch set. Patches, previously available in lcd-filtering overlay, now merged into main Gentoo portage tree.
+
Console fonts for tty's are easily configurable, and testable.
  
<console>
+
{{console|body=
###i## echo "media-libs/fontconfig infinality" >> /etc/portage/package.use
+
###i## cd /usr/share/consolefonts/
###i## emerge -uN fontconfig
+
###i## ls #todisplaythefont files
</console>
+
###i## setfont default8x9 #sets the 8x9 default font (this will be tiny, and you may not like it)
== Advanced configuration ==
+
###i## setfont #returns the system to the system default}}
=== Fontconfig ===
+
==== Default configuration ====
+
  
<console>
+
Once you determine the font you like make it the system default:
 +
 
 +
{{file|name=/etc/conf.d/consolefont|lang=|desc=setting the system default font to the tiny text default8x9|body=
 +
consolefont="default8x9"
 +
}}
 +
 
 +
More console font packages exist in portage:
 +
{{console|body=
 +
###i## emerge media-fonts/terminus-font
 +
}}
 +
 
 +
The readme files in /usr/share/consolefonts contain valuable information, make sure to go through them.
 +
 
 +
== Fontconfig ==
 +
By default font configurations do not look ideal.  This can be solved by rebuilding {{c|media-libs/freetype}} with the infinality USE flag, which applies the infinality patch set.
 +
 
 +
{{console|body=
 +
###i## echo "media-libs/freetype infinality" >> /etc/portage/package.use
 +
###i## emerge -uN fontconfig }}
 +
 
 +
=== Default configuration ===
 +
 
 +
{{console|body=
 
###i## eselect fontconfig enable 10-antialias.conf
 
###i## eselect fontconfig enable 10-antialias.conf
 
###i## eselect fontconfig enable 10-autohint.conf   
 
###i## eselect fontconfig enable 10-autohint.conf   
Line 24: Line 44:
 
###i## eselect fontconfig disable 10-sub-pixel-vbgr.conf   
 
###i## eselect fontconfig disable 10-sub-pixel-vbgr.conf   
 
###i## eselect fontconfig disable 10-sub-pixel-vrgb.conf   
 
###i## eselect fontconfig disable 10-sub-pixel-vrgb.conf   
###i## eselect fontconfig disable 10-unhinted.conf</console>
+
###i## eselect fontconfig disable 10-unhinted.conf}}
 
===Linux configuration ===
 
===Linux configuration ===
  
 
Same as default configuration except:
 
Same as default configuration except:
<console>
+
{{console|body=
 
###i## eselect fontconfig enable 21-hinting-small-aquabase-slight.conf
 
###i## eselect fontconfig enable 21-hinting-small-aquabase-slight.conf
 
###i## eselect fontconfig enable 21-hinting-small-browallia-slight.conf   
 
###i## eselect fontconfig enable 21-hinting-small-browallia-slight.conf   
###i## eselect fontconfig enable 22-hinting-courier-italic-slight.conf
+
###i## eselect fontconfig enable 22-hinting-courier-italic-slight.conf}}
</console>
+
 
 
=== Infinality’s configuration ===
 
=== Infinality’s configuration ===
  
 
Same as default configuration except:
 
Same as default configuration except:
<console>
+
{{console|body=
 
###i## eselect fontconfig enable 15-hinting-tt-instructed-full.conf
 
###i## eselect fontconfig enable 15-hinting-tt-instructed-full.conf
 
###i## eselect fontconfig enable 20-hinting-small-fonts-slight.conf   
 
###i## eselect fontconfig enable 20-hinting-small-fonts-slight.conf   
Line 42: Line 62:
 
###i## eselect fontconfig enable 21-hinting-small-browallia-slight.conf   
 
###i## eselect fontconfig enable 21-hinting-small-browallia-slight.conf   
 
###i## eselect fontconfig enable 22-hinting-courier-italic-slight.conf   
 
###i## eselect fontconfig enable 22-hinting-courier-italic-slight.conf   
###i## eselect fontconfig enable 25-hinting-small-arial-black-slight.conf
+
###i## eselect fontconfig enable 25-hinting-small-arial-black-slight.conf}}
</console>
+
 
 
=== Windows configuration ===
 
=== Windows configuration ===
  
 
Same as default except:
 
Same as default except:
<console>
+
{{console|body=
 
###i## eselect fontconfig disable 10-autohint.conf
 
###i## eselect fontconfig disable 10-autohint.conf
 
###i## eselect fontconfig disable 10-hinting-slight.conf   
 
###i## eselect fontconfig disable 10-hinting-slight.conf   
Line 56: Line 76:
 
###i## eselect fontconfig enable 21-hinting-small-browallia-slight.conf   
 
###i## eselect fontconfig enable 21-hinting-small-browallia-slight.conf   
 
###i## eselect fontconfig enable 22-hinting-courier-italic-slight.conf   
 
###i## eselect fontconfig enable 22-hinting-courier-italic-slight.conf   
###i## eselect fontconfig enable 25-hinting-small-arial-black-slight.conf
+
###i## eselect fontconfig enable 25-hinting-small-arial-black-slight.conf}}
</console>
+
 
 
=== OSX configuration ===
 
=== OSX configuration ===
  
 
Same as default configuration except:
 
Same as default configuration except:
<console>
+
{{console|body=
 
###i## eselect fontconfig disable 10-autohint.conf
 
###i## eselect fontconfig disable 10-autohint.conf
 
###i## eselect fontconfig disable 10-hinting.conf   
 
###i## eselect fontconfig disable 10-hinting.conf   
 
###i## eselect fontconfig disable 10-hinting-slight.conf   
 
###i## eselect fontconfig disable 10-hinting-slight.conf   
 
###i## eselect fontconfig enable 10-unhinted.conf   
 
###i## eselect fontconfig enable 10-unhinted.conf   
###i## eselect fontconfig enable 15-hinting-tt-instructed-none.conf
+
###i## eselect fontconfig enable 15-hinting-tt-instructed-none.conf}}
</console>
+
== Freetype ==
+
Freetype can be configured through environment variables (see <tt>/etc/env.d/99lcdfilter</tt> for a list of the variables and their description). Those variables can be overridden on a per-user basis by either redefining them in a startup file (such as <tt>~/.bash_profile</tt>) or by sourcing the <tt>/usr/lib/ft-settings.sh</tt> script with the desired style in parameter (you can, of course, source the script from a startup file).
+
  
usage: source ft-settings.sh <style>
+
=== Freetype ===
 +
Freetype can be configured through environment variables (see {{f|/etc/env.d/99lcdfilter}} for a list of the variables and their description). Those variables can be overridden on a per-user basis by either redefining them in a startup file (such as {{f|~/.bash_profile}}) or by sourcing the {{f|/usr/lib/ft-settings.sh}} script with the desired style in parameter (you can, of course, source the script from a startup file).
  
<console>
+
usage:
 +
 
 +
{{console|body=
 +
###i## source /usr/lib/ft-settings.sh
 
Possible styles:   
 
Possible styles:   
 
   default      - Use default settings.  A compromise that should please most people   
 
   default      - Use default settings.  A compromise that should please most people   
Line 89: Line 110:
 
   sharpened    - Full stem snapping, tweaks, and Windows-style sharpening   
 
   sharpened    - Full stem snapping, tweaks, and Windows-style sharpening   
 
   infinality  - Settings used by Infinality
 
   infinality  - Settings used by Infinality
</console>
+
}}
== LibXft ==
+
 
Only legacy programs still use libXft. The default configuration is defined in <tt>/usr/share/X11/app-defaults/Xft</tt>. It can be overriden on a per-user basis in the <tt>~/.Xresources</tt> or <tt>~/.Xdefaults</tt> files:
+
=== LibXft ===
 +
Only legacy programs still use libXft. The default configuration is defined in {{f|/usr/share/X11/app-defaults/Xft}}. It can be overriden on a per-user basis in the {{f|~/.Xresources}} or {{f|~/.Xdefaults}} files:
  
<console>
+
{{file|name=~/.Xdefaults|desc= |body=
 
Xft.antialias:  1
 
Xft.antialias:  1
 
Xft.autohint:  0   
 
Xft.autohint:  0   
Line 101: Line 123:
 
Xft.lcdfilter:  lcddefault   
 
Xft.lcdfilter:  lcddefault   
 
Xft.rgba:      rgb
 
Xft.rgba:      rgb
</console>
+
}}
  
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]

Latest revision as of 08:40, May 8, 2015

Console Only Fonts

Console fonts for tty's are easily configurable, and testable.

# cd /usr/share/consolefonts/
# ls #todisplaythefont files
# setfont default8x9 #sets the 8x9 default font (this will be tiny, and you may not like it)
# setfont #returns the system to the system default


Once you determine the font you like make it the system default:

/etc/conf.d/consolefont - setting the system default font to the tiny text default8x9
consolefont="default8x9"

More console font packages exist in portage:

# emerge media-fonts/terminus-font


The readme files in /usr/share/consolefonts contain valuable information, make sure to go through them.

Fontconfig

By default font configurations do not look ideal. This can be solved by rebuilding media-libs/freetype with the infinality USE flag, which applies the infinality patch set.

# echo "media-libs/freetype infinality" >> /etc/portage/package.use
# emerge -uN fontconfig


Default configuration

# eselect fontconfig enable 10-antialias.conf
# eselect fontconfig enable 10-autohint.conf  
# eselect fontconfig enable 10-hinting.conf  
# eselect fontconfig enable 10-hinting-slight.conf  
# eselect fontconfig enable 10-sub-pixel-rgb.conf  
# eselect fontconfig enable 11-lcdfilter-default.conf  
# eselect fontconfig enable 70-no-bitmaps.conf  
# eselect fontconfig disable 10-hinting-full.conf  
# eselect fontconfig disable 10-hinting-medium.conf  
# eselect fontconfig disable 10-no-sub-pixel.conf  
# eselect fontconfig disable 10-sub-pixel-bgr.conf  
# eselect fontconfig disable 10-sub-pixel-vbgr.conf  
# eselect fontconfig disable 10-sub-pixel-vrgb.conf  
# eselect fontconfig disable 10-unhinted.conf

Linux configuration

Same as default configuration except:

# eselect fontconfig enable 21-hinting-small-aquabase-slight.conf
# eselect fontconfig enable 21-hinting-small-browallia-slight.conf  
# eselect fontconfig enable 22-hinting-courier-italic-slight.conf


Infinality’s configuration

Same as default configuration except:

# eselect fontconfig enable 15-hinting-tt-instructed-full.conf
# eselect fontconfig enable 20-hinting-small-fonts-slight.conf  
# eselect fontconfig enable 21-hinting-small-aquabase-slight.conf  
# eselect fontconfig enable 21-hinting-small-browallia-slight.conf  
# eselect fontconfig enable 22-hinting-courier-italic-slight.conf  
# eselect fontconfig enable 25-hinting-small-arial-black-slight.conf


Windows configuration

Same as default except:

# eselect fontconfig disable 10-autohint.conf
# eselect fontconfig disable 10-hinting-slight.conf  
# eselect fontconfig enable 10-hinting-full.conf  
# eselect fontconfig enable 15-hinting-non-tt-instructed-slight.conf  
# eselect fontconfig enable 20-hinting-small-fonts-slight.conf  
# eselect fontconfig enable 21-hinting-small-aquabase-slight.conf  
# eselect fontconfig enable 21-hinting-small-browallia-slight.conf  
# eselect fontconfig enable 22-hinting-courier-italic-slight.conf  
# eselect fontconfig enable 25-hinting-small-arial-black-slight.conf


OSX configuration

Same as default configuration except:

# eselect fontconfig disable 10-autohint.conf
# eselect fontconfig disable 10-hinting.conf  
# eselect fontconfig disable 10-hinting-slight.conf  
# eselect fontconfig enable 10-unhinted.conf  
# eselect fontconfig enable 15-hinting-tt-instructed-none.conf


Freetype

Freetype can be configured through environment variables (see /etc/env.d/99lcdfilter for a list of the variables and their description). Those variables can be overridden on a per-user basis by either redefining them in a startup file (such as ~/.bash_profile) or by sourcing the /usr/lib/ft-settings.sh script with the desired style in parameter (you can, of course, source the script from a startup file).

usage:

# source /usr/lib/ft-settings.sh
Possible styles:   
  default      - Use default settings.  A compromise that should please most people  
  osx          - Simulate OSX rendering  
  ubuntu       - Simulate UBUNTU rendering  
  linux        - Generic Linux style - no snapping or certain other tweaks  
  windows      - Simulate Windows rendering  
  vanilla      - Just subpixel hinting

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 used by Infinality


LibXft

Only legacy programs still use libXft. The default configuration is defined in /usr/share/X11/app-defaults/Xft. It can be overriden on a per-user basis in the ~/.Xresources or ~/.Xdefaults files:

~/.Xdefaults
Xft.antialias:  1
Xft.autohint:   0  
Xft.dpi:        96  
Xft.hinting:    1  
Xft.hintstyle:  hintfull  
Xft.lcdfilter:  lcddefault  
Xft.rgba:       rgb