1 /* aafont.c - generic library for drawing anti-aliased fonts
2    Copyright (C) 1996-2017 Paul Sheer
3 
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2 of the License, or
7    (at your option) any later version.
8 
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13 
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17    02111-1307, USA.
18  */
19 
20 void XAaFree (Font fid);
21 
22 void XAaInit (Display * display, Visual * visual, int depth, Window root);
23 
24 int XAaTextWidth (XFontStruct * font_struct, char *s, int length);
25 
26 int XAaTextWidth16 (XFontStruct * font_struct, XChar2b * s, int length);
27 
28 int XAaDrawImageString (Display * display, Drawable d, GC gc, int x, int y, char *s, int length);
29 
30 int XAaDrawImageString16 (Display * display, Drawable d, GC gc, int x, int y, XChar2b * wc, int length);
31 
32 #define RedFirst 0
33 #define BlueFirst 1
34 
35 extern int option_interchar_spacing;
36 extern int option_rgb_order;
37 
38 
39 #define X_ENLARGEMENT	3
40 #define Y_ENLARGEMENT	5
41 
42 #define SHRINK_WIDTH(x) (((x) + X_ENLARGEMENT) / 3 + option_interchar_spacing)
43 #define SHRINK_HEIGHT(x) (((x) + Y_ENLARGEMENT) / 3)
44