gtk-font-hack
The gtk-font-hack is a patch against the GDK (distributed with
the GTK). It smooths fonts in GTK and GNOME programs. As its name
suggests, it is a hack and really font smoothing should be done in
other ways. The patch will therefore not be included in the GDK
distribution for the foreseeable future.
It works by drawing text on an off-screen buffer and then
drawing it quarter size (half length) on to the screen. The result
is that fonts appear to have been anti-aliased (badly) and a
quarter of their normal size. Even unscalable fonts are
smoothed. It would probably be more accurate to call the process
"smudging".
If you use this program, contact me. I shall not continue
development unless someone offers to help or it seems a bunch of
people want me to. I haven't the time otherwise.
Issues to be fixed
- Hopefully no memory leaks.
- Could be speeded up immensely. At the moment absolutely
nothing has been optimized.
- Will probably only work on 24 bit displays. I'm not sure
how to do the color blending properly.
- Do 16-bit characters come out right?
Version 0.2-gtk-1.2.6
Beta (i.e. doesn't work properly but doesn't core dump on me
any more).
I should appreciate help!
Changes
- Code tidying and initial preparation for integration into
GDK distribution.
- Fixed a couple of major bugs.
Known bugs
Please report bugs.
- Selecting text makes a mess of it sometimes, with extra
space intruding all over the place.
- Some programs start eating all the CPU (e.g. gfontsel most
times when the Font Information tab is clicked), apparently
trying to get sizes for things. Can't reproduce this bug any
more.
- For some reason fonts are not smudged in gnome-o-terminal
programs (e.g. gnome-terminal, gnome-genius), though the size
allowed for them is halved. Must check up on this widget.
- The right part of GHex's left display window with the hex
in it is missing inexplicably.
- Text draw functions mess with the GC they are given, which
is obviously not a good idea, but it doesn't seem to do any
harm.
- When the GTK draws the same text twice in the same place
without clearing, the edges are darkened. I guess this is done
in too many places to fix quickly.
Please report bugs.
If you use this program, contact me. I shall not continue
development unless someone offers to help or it seems a bunch of
people want me to. I haven't the time otherwise.
Recipe
- Download
- Get GTK sources. Might
not work on versions other than 1.2.6, but I'd guess it probably
will on quite a range.
- Untar and patch (you might need GNU patch)
% tar zxf /incoming/gtk-1.2.6.tar.gz
% cd gtk-1.2.6
% patch -p1 < /incoming/gtk-font-hack-0.2-gtk-1.2.6.diff
- configure; make, as usual.
- You can try it out without installing, by
export LD_PRELOAD=$(PATH_TO_GTK_SOURCE)/gtk+-1.2.6/gdk/.libs/libgdk-1.2.so
and then running your GTK/GNOME programs as usual (obviously from this
same terminal).
- You should double the point size of the fonts in your
gtkrc, to get the same size displayed. Ditto for any other fonts you
might use.
Version 0.1-gtk-1.2.6
Alpha (i.e. doesn't work properly).
I should appreciate help!
Known bugs
Please report bugs.
- Selecting text makes a mess of it, with extra space
intruding all over the place.
- Some programs start eating all the CPU
(e.g. gfontsel most times when the Font Information tab is
clicked), apparently trying to get sizes for things.
- gless's display is completely messed up.
Please report bugs.
Recipe
- Download
- Get GTK sources. Might
not work on versions other than 1.2.6, but I'd guess it probably
will on quite a range.
- Untar and patch (you might need GNU patch)
% tar zxf /incoming/gtk-1.2.6.tar.gz
% cd gtk-1.2.6
% patch -p1 < /incoming/gtk-font-hack-0.1-gtk-1.2.6.diff
- configure; make, as usual.
- You can try it out without installing, by
export LD_PRELOAD=$(PATH_TO_GTK_SOURCE)/gtk+-1.2.6/gdk/.libs/libgdk-1.2.so.0.5.1
and then running your GTK/GNOME programs as usual (obviously from this
same terminal).
- You should double the point size of the fonts in your
gtkrc, to get the same size displayed. Ditto for any other fonts you
might use.