font-selector

Summary

Enhance the font setting tool in gnome and KDE to manipulate the system-wide or user-based fontconfig configuration. This includes settings like font reordering for serif, sans-serif and monospace meta fonts, anti-aliasing, hinting and embedded bitmap handling.

Release Note

In the past users often complained about the default font settings in Ubuntu, however each user has different preferences. To have one font configuration which suits all users is simply impossible. Therefore we give the users the opportunity to change the default font settings in the font setting dialog according to their liking. The settings which can be modified with this tool include: font reordering for serif, sans-serif and monospace meta fonts, anti-aliasing, hinting and embedded bitmap handling on a per-font basis.

Rationale

In the past users often complained about the default font settings in Ubuntu, however each user has different preferences. To have one font configuration which suits all users is simply impossible. We need to give the users the possibility to manipulate the default font settings according to their liking.

In detail, we currently have the following situation:

  1. fontconfig provides a low level method to configure and manipulate font settings
    1. distribution wide (/etc/fonts/conf.avail/ and /etc/fonts/conf.d/)
    2. system wide (/etc/fonts/local.conf) -- overrides settings in /etc/fonts/conf.d/
    3. by user (~/.fonts.conf) -- overrides system wide and distribution wide settings
  2. KDE uses fontconfig by default and uses ~/.fonts.conf when settings in Appearances/Fonts are changed.
  3. Gnome has its own way to store this configuration information. The Gnome settings override the fontconfig settings in Gnome applications.
    • need to cause running applications to be updated
    • gnome-settings-daemon uses X Settings to communicate this to running applications
  4. Problems we face:
    1. Users have different preferences about font settings, which cannot be satisfied with a 'one configuration fits all' approach. This includes:
      • Anti-aliasing on/off/embedded bitmaps for CJK
      • Hinting (autohinting on/off/binary hinting)
      • Font ordering for the meta fonts (serif, sans-serif, monospace)
      • cannot be set by locale as users use all kinds of locales to display all kinds of scripts, however, we can suggest a font ordering based on the user's locale setting.
    2. Full implementation requires language tags for text (which many applications do not support), but a lesser implementation is possible

Use Cases

  • User A uses en_US and wants to use DejaVu as his default fonts and Japanese fonts for CJK text

  • User B uses en_US and wants to use a Chinese font for CJK text instead of the Japanese font.
  • User C uses zh_CN and prefers the Latin glyphs from the Chinese font
  • User D uses zh_CN and prefers the Latin glyphs from DejaVu instead of the Chinese font

  • User E uses a low resolution monitor and prefers to use small font sizes to display text. As CJK glyphs are nearly unreadable at those settings, he turns on the embedded bitmaps to get a sharper rendering.
  • User F dislikes embedded bitmaps in CJK fonts and likes to use autohinting instead.

Assumptions

Design

The font selection tool reads the system wide and local user fontconfig configurations and displays the current configuration in a GUI with multiple options, e.g. different tabs for font reordering, anti-aliasing, hinting and other important settings. Changes will be stored in a separate config file, which overrides the existing fontconfig configuration.

  • GUI interface to manipulate fontconfig settings per user / system wide
  • uses ~/.fonts.conf to store configuration data
  • allows users to adjust the order of the available fonts for each metafont
    • can be different for different lang codes (requires applications to support XML/HTML and to define the lang tag per paragraph)
  • manage settings for hinting, anti-aliasing and embedded bitmaps on a per font (and optionally language) level.

GUI design

The current Gnome and KDE font setting dialogs need to be redesigned. Matthew Paul Thomas will provide suggestions for this.

  • This application should not be used to "unbreak my desktop", but select between different legitimate settings
    • hinting on/off/autohint/binary hinting/embedded bitmaps
    • RGBA on or off (anti-aliasing)
  • Superset of the current font tab in gnome-appearance-applet; should go upstream
    • Extends the current font tab with a language selector, and possibly other widgets; the existing font widgets are downsized to not take too much space
    • Current global font selection works fine for Latin-only users, but are useless for people needing both Latin and CJK
    • per-font selection, sorted by preference
    • By-language settings

TBC

additional user requests (may be implemented later)

  • manage installation/removal of font packages based on the the selected font family
  • have a preview area to see how the actual setting will look like
  • enable/disable fonts without removing them from the system (KDE is doing this already)
  • add custom non-packaged fonts and enable/disable them

Implementation

  • modify the existing font setting dialogs in Gnome and KDE to include the new features
  • need to look into available font files which features they provide (binary hints, embedded bitmaps)
  • Andrew Walton takes general implementation task
  • mpt gave/will give design suggestions
  • pitti helps with XML reading/writing and reviewing the app changes
  • Arne is responsible for functionality specification
  • equivalent implementation for KDE: TBD

Test/Demo Plan

Things to watch out for

  • Firefox upstream decided to improve font antialiasing; latest builds show huge regression wrt. rendering, because of bad interactions with current font rendering Ubuntu patch (https://bugzilla.mozilla.org/show_bug.cgi?id=458612)

  • We have multiple hinting settings; full hinting only works with fonts which are hinted (only Dejavu); for the others we have the autohinting module
    • upstream has no default
    • Ubuntu has slight hinting (intrepid)
  • KDE just uses "system default", and because this was not defined, it looked very ugly; thus Arne set the default in the fontconfig package to slight hinting
  • fontconfig bug: user settings do not always override system settings; this needs to be fixed

Default font settings

  • We can supply better defaults for per-language font settings, so that the majority of users don't need to have it
  • Can't cover all cases, such as "will Japanese or Chinese look better in an English locale"
  • mostly CJK text with embedded Latin words: should use the latin chars from the CJK fonts, since they better match the CJK metrics/style/spacing
  • longer areas with latin words: use the latin fonts, since they look much better
  • European users which want to use CJK text have different font preferences than Asian users who occasionally work with English texts


CategorySpec

font-selector (last edited 2008-12-17 15:57:26 by arnegoetje)