1 <refentry id="gtk-framebuffer" revision="1 Jan 2002">
3 <refentrytitle>Framebuffer</refentrytitle>
4 <manvolnum>3</manvolnum>
5 <refmiscinfo>GTK Library</refmiscinfo>
9 <refname>Using GTK+ on the Framebuffer</refname>
11 Using embedded GTK+ on the Linux framebuffer
16 <title>GTK+ for the Linux Framebuffer</title>
19 The linux-fb port of GTK+, also known as GtkFB is an implementation of
20 GDK (and therefore GTK+) that runs on the linux framebuffer. It runs in
21 a single process that doesn't need X. It should run most GTK+ programs
22 without any changes to the source.
25 <refsect2><title>Build requirements</title>
27 You need GTK+ 2.0; the 1.2.x series does not have framebuffer support.
28 To compile GTK+ with framebuffer support you will need freetype 2, we
29 recommend FreeType 2.0.1 or later, as there was some problems with
30 freetype-config in 2.0. Make sure that you install freetype before
31 Pango, since Pango also needs it. Freetype can be found at
32 ftp://ftp.freetype.org
36 <refsect2><title>Hardware requirements</title>
38 You need a graphics card with an availible framebuffer driver that can
39 run in 8, 16, 24 or 32 bpp, such as matroxfb or vesafb. You also need
40 a supported mouse. GTK+ currently supports the ps2 mouse, ms serial
41 mouse and fidmour touchscreen. Additional hardware support should
46 <refsect2><title>Building and installing</title>
48 First build and install glib and pango as usual, in that order.
50 Then configure Gtk by running configure (or autogen.sh if running from
51 CVS) with <literal>--with-gdktarget=linux-fb</literal>.
54 <para>Then compile as ususal: make; make install</para>
57 <refsect2><title>Fonts</title>
59 Since GtkFB uses freetype 2 to render fonts it can render truetype and
60 postscript type 1 antialiased fonts.
63 <para>At startup it scans some directories looking for fonts. By default
64 it looks in $prefix/lib/ft2fonts, and if you want to change this you
65 must add something like:
69 FontPath = /usr/share/fonts/default/Type1:/usr/share/fonts/default/TrueType
72 To your <filename>$prefix/etc/pango/pangorc</filename> or <filename>~/.pangorc</filename>.
76 You must also set up font aliases for the fonts Sans, Serif and
77 Monotype. This is done by creating a
78 <filename>$prefix/etc/pango/pangoft2.aliases</filename> or
79 <filename>~/.pangoft2_aliases</filename> file. You can also set the name of this file using
80 the key AliasFiles in the PangoFT2 section in pangorc.
84 An example of a font alias file for the urw fontset is:
86 sans normal normal normal normal "urw gothic l"
87 serif normal normal normal normal "urw palladio l"
88 monospace normal normal normal normal "nimbus mono l"
93 And one using the Windows truetype fonts is:
95 sans normal normal normal normal "arial"
96 serif normal normal normal normal "times new roman"
97 monospace normal normal normal normal "courier new"
100 A more detailed example can be found in examples/pangoft2.aliases in the
105 <refsect2><title>Running</title>
107 To run a program you should only need to start it, but there are some
108 things that can cause problems, and some things that can be controlled
109 by environment variables. Try testgtk distributed with GTK+ to test
114 If you use a ps2 mouse, make sure that /dev/psaux is readable and
118 <para>Make sure gpm is not running.</para>
120 <para>If you don't specify anything GtkFB will start up in the current
121 virtual console in the current resolution and bit-depth. This can be
122 changed by specifying environment variables:
128 unset means open on the current VT.
129 0-9: open on the specified VT. Make sure you have read/write rights
131 new: Allocate a new VT after the last currently used one.
134 Specifies the name of a mode in /etc/fb.modes that you want to use.
137 Specify the desired bit depth of the framebuffer.
140 Specify the desired width of the framebuffer.
143 Specify the desired height of the framebuffer.
146 Specify the framebuffer device to use. Default is /dev/fb0
149 Specify mouse type. Currently supported is:
151 imps2 - PS/2 intellimouse (wheelmouse)
152 ms - Microsoft serial mouse
153 fidmour - touch screen
157 Specify keyboard type. Currently supported is
158 xlate - normal tty mode keyboard.
159 Quite limited, cannot detect key up/key down events. Doesn't
160 handle ctrl/alt/shift for all keys. This is the default driver,
161 but should not be used in "production" use.
162 raw - read from the tty in RAW mode.
163 Sets the keyboard in RAW mode and handles all the keycodes. This
164 gives correct handling of modifiers and key up/down events. You
165 must be root to use this. If you use this for development or
166 debugging it is recommended to enable magic sysrq handling in the
167 kernel. Then you can use ALT-SysRQ-r to turn the keyboard back to
174 <refsect2><title>Debug features</title>
175 <para>Pressing Ctrl-Alt-Return repaints the whole screen.
176 Unfortunately this cannot be pressed when using the xlate keyboard
177 driver, so instead you can use shift-F1 instead when using this
181 <para>Pressing Ctrl-Alt-BackSpace kills the GtkFB program. (Can't be pressed
182 in the xlate driver.)</para>