== How to enable anti-aliased fonts on Linux == [[PageOutline(3)]] Recent '''stx:libview''' contains support for anti-aliased font rendering using [[http://www.freedesktop.org/wiki/Software/fontconfig/|fontconfig]] and [[http://en.wikipedia.org/wiki/Xft|Xft]]. This text describes how to enable and use Xft font rendering. {{{ #!div class="note" Xft support is an experimental feature currently under testing. Things may not work as expected. If you find some problem, please report it [[/newticket|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 === * [[attachment:Workspace 2_025_doubled.png|Detail showing difference between core X rendering and Xft]] * [[attachment:Workspace 2_025.png|Browser window with text rendered using core X protocol and with Xft]] === Known Issues === [[TicketQuery(keywords=~xft)]] === TODO === See [[/ticket/21#comment:5|this comment]]