+/*
+ * We support two entirely different drawing systems: the old
+ * GDK1/GDK2 one which works on server-side X drawables, and the
+ * new-style Cairo one. GTK1 only supports GDK drawing; GTK3 only
+ * supports Cairo; GTK2 supports both, but deprecates GTK, so we only
+ * enable it if we aren't trying on purpose to compile without the
+ * deprecated functions.
+ *
+ * Our different font classes may prefer different drawing systems: X
+ * server-side fonts are a lot faster to draw with GDK, but for
+ * everything else we prefer Cairo, on general grounds of modernness
+ * and also in particular because its matrix-based scaling system
+ * gives much nicer results for double-width and double-height text
+ * when a scalable font is in use.
+ */
+#if !GTK_CHECK_VERSION(3,0,0) && !defined GDK_DISABLE_DEPRECATED
+#define DRAW_TEXT_GDK
+#endif
+#if GTK_CHECK_VERSION(2,8,0)
+#define DRAW_TEXT_CAIRO
+#endif
+
+#if GTK_CHECK_VERSION(3,0,0) || defined GDK_DISABLE_DEPRECATED
+/*
+ * Where the facility is available, we prefer to render text on to a
+ * persistent server-side pixmap, and redraw windows by simply
+ * blitting rectangles of that pixmap into them as needed. This is
+ * better for performance since we avoid expensive font rendering
+ * calls where possible, and it's particularly good over a non-local X
+ * connection because the response to an expose event can now be a
+ * very simple rectangle-copy operation rather than a lot of fiddly
+ * drawing or bitmap transfer.
+ *
+ * However, GTK is deprecating the use of server-side pixmaps, so we
+ * have to disable this mode under some circumstances.
+ */
+#define NO_BACKING_PIXMAPS
+#endif
+