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:
- Install fontconfig and Xft development libraries:
- On Ubuntu/Debian?:
apt-get install libxft-dev libxft2:i386
- On OpenSUSE:
???
- On Ubuntu/Debian?:
- 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
- (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
- Detail showing difference between core X rendering and Xft
- Browser window with text rendered using core X protocol and with Xft
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
Attachments (2)
-
Workspace 2_025.png (308.7 KB) - added by 9 years ago.
Comparison of core X text rendering (left) and Xft text rendering (right)
-
Workspace 2_025_doubled.png (101.2 KB) - added by 9 years ago.
Comparison of core X text rendering (left) and Xft text rendering (right) - enlarged
Download all attachments as: .zip