Faculty of Information Technology
Software Engineering Group

How to enable anti-aliased fonts on Linux

Recent stx:libview contains support for anti-aliased font rendering using fontconfig and Xft. This text describes how to enable and use Xft font rendering.

Xft support is an experimental feature currently under testing. Things may not work as expected. If you find some problem, please report it here.

Building Xft-enabled stx:libview

By default, Xft support is not compiled in. To do so, you have to:

  1. Install fontconfig and Xft development libraries:
    • On Ubuntu/Debian?: apt-get install libxft-dev libxft2:i386
    • On OpenSUSE: ???
  2. Add following to the end of stx/configurations/myConf:
    XDEFS+=-DXFT
    XINCLUDE+=$(shell pkg-config --cflags xft)
    LIB_XFT=-l:libXft.so.2 -l:libfontconfig.so.1
    
  3. (Re)compile stx:libview (when recompiling, make sure you have removed XftFontDescription.[oH] before!)

Configuring Smalltalk/X to use Xft fonts

Even if Xft support is compiled in, text is not rendered using Xft by default.

To use Xft-rendered fonts, put following to your ~/.smalltalk/p_$USER.rc:

View defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
Label defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
CheckBox defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
CheckLabel defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
Button defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
Toggle defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
SelectionInListView defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
MenuView defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
MenuPanel defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
NoteBookView defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
PullDownMenu defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
TextView defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
EditTextView defaultFont: (XftFontDescription family: 'DejaVu Sans' size: 10).
CodeView defaultFont: (XftFontDescription family: 'DejaVu Sans Mono' size: 10).
Tools::CodeView2::TextView defaultFont: (XftFontDescription family: 'DejaVu Sans Mono' size: 10).

Change families and sizes to your personal taste.

Screenshots

Known Issues

#24
RenderBadPicture (invalid Picture parameter) error when using Xft rendering
#25
Tab labels not rendered properly when using Xft rendereing
#27
No text rendered in ChangesBrowser when using Xft fonts
#28
EditTextView has artefacts when rendered using Xft
#30
XftFontDescription should respond to #encoding
#33
XftFontDescription causes crash on snapshot restart

TODO

See this comment

Last modified 4 years ago Last modified on Jan 7, 2014, 6:17:16 PM

Attachments (2)

Download all attachments as: .zip