Fonts: Difference between revisions

From miki
Jump to navigation Jump to search
Line 57: Line 57:
== Font Rendering ==
== Font Rendering ==
* [https://www.smashingmagazine.com/2012/04/a-closer-look-at-font-rendering/ A Closer Look At Font Rendering]
* [https://www.smashingmagazine.com/2012/04/a-closer-look-at-font-rendering/ A Closer Look At Font Rendering]

== Troubleshooting ==
=== MS Fonts not rendering correctly ===
This occurs for instance with font '''Calibri'''. At small size, normal character appears aliased, but ligatures are anti-aliased.


Solution is to disable use of ''embedded bitmaps'' [http://askubuntu.com/questions/594976/how-to-get-calibri-font-to-display-nicely]:
* Add to file {{file|~/.config/font-manager/local.conf}} (before Ubuntu 14.04, edit {{file|~/.fonts.conf}}):
<source lang=xml>
<!-- disable embedded bitmaps in fonts to fix Calibri, Cambria, etc. -->
<match target="font">
<edit mode="assign" name="embeddedbitmap"><bool>false</bool></edit>
</match>
</source>

* rebuild font cache:
<source lang=bash>
sudo fc-cache -v -f
</source>
* Restart compiz:
<source lang=bash>
compiz --replace&
</source>

Revision as of 17:45, 24 May 2016

Administration

Installing Fonts on Ubuntu

  • References

Fonts are kept in different locations, as defined in /etc/fonts/fonts.conf. By default these are:

  • /usr/share/fonts
  • /usr/local/share/fonts
  • /home/username/.fonts

To install a new font, copy the font to the relevant directory (or a sub-directory), and update the cache with

sudo fc-cache -f -v

Alternatively the cache is immediately refreshed after reboot.

For instance to install Arial Unicode MS (ARIALUNI.TTF, can be found on Windows XP for instance):

sudo mkdir /usr/share/fonts/truetype/windows
sudo cp ARIALUNI.TTF /usr/share/fonts/truetype/windows
sudo chmod 644 /usr/share/fonts/truetype/windows/*
sudo fc-cache -f -v

Querying font

fc-match matches available fonts:

fc-match calibri
calibri.ttf: "Calibri" "Regular"

Nice Fonts

Monospace

Bitstream Vera Sans Mono
My previous favorite
Consolas
DejaVu Sans Mono
Based on BitStream Vera (almost identical), but with better Unicode support.
Inconsolata
Looks nice but fonts are really small at size 9
Lucida Console
My current favorite for terminal, got from MacBuntu 10.04 theme
Monospace
Same as Bitstream Vera Sans Mono
Source Code Pro
Ubuntu Mono

Serif

Sans

Font Rendering

Troubleshooting

MS Fonts not rendering correctly

This occurs for instance with font Calibri. At small size, normal character appears aliased, but ligatures are anti-aliased.


Solution is to disable use of embedded bitmaps [1]:

  • Add to file ~/.config/font-manager/local.conf (before Ubuntu 14.04, edit ~/.fonts.conf):
<!-- disable embedded bitmaps in fonts to fix Calibri, Cambria, etc. -->
<match target="font">
        <edit mode="assign" name="embeddedbitmap"><bool>false</bool></edit>
</match>
  • rebuild font cache:
sudo fc-cache -v -f
  • Restart compiz:
compiz --replace&