x_afftext.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* This file is part of the GNU plotutils package. Copyright (C) 1995,
  2. 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc.
  3. The GNU plotutils package is free software. You may redistribute it
  4. and/or modify it under the terms of the GNU General Public License as
  5. published by the Free Software foundation; either version 2, or (at your
  6. option) any later version.
  7. The GNU plotutils package is distributed in the hope that it will be
  8. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. General Public License for more details.
  11. You should have received a copy of the GNU General Public License along
  12. with the GNU plotutils package; see the file COPYING. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor,
  14. Boston, MA 02110-1301, USA. */
  15. /* This is a header file for the XAffText module, which was originally
  16. independent of libplot. The module is in x_afftext.c. It may be used
  17. independently of libplot.
  18. To use the module independently of libplot, simply do not specify
  19. "-DLIBPLOT" at compile time.
  20. The module supplies two external functions, which are generalizations of
  21. the core X11 function XDrawString: XAffDrawRotString and
  22. XAffDrawAffString. They draw, respectively, a rotated text string and
  23. (more generally) a matrix-transformed text string, using a specified
  24. core X font. The rotation angle and transformation matrix are specified
  25. by the user. The matrix is passed as a 4-element array, with the
  26. element ordering convention, and sign conventions, being those of the
  27. Matrix XLFD extension.
  28. `XAffText' is an abbreviation of `X11 affinely transformed text'. The
  29. module was inspired by Alan Richardson's xvertext module for displaying
  30. rotated text strings in X11, using the core X fonts. It works in a
  31. similar way. (It retrieves a bitmap from the X server into an XImage,
  32. transforms the XImage, monochrome pixel by pixel, and sends it back to a
  33. bitmap on the server, for use as a stipple.) But it supports arbitrary
  34. transformation matrices, and pays extra attention to pixel-level
  35. accuracy. It uses integer arithmetic when possible. */
  36. #include <X11/Xlib.h>
  37. #ifdef LIBPLOT
  38. /* Change the names of the two external functions of the module by
  39. prepending "_x_" to them, for consistency with other internal (but
  40. externally visible) X11-related functions in libplot. */
  41. #define XAffDrawAffString _pl_XAffDrawAffString
  42. #define XAffDrawRotString _pl_XAffDrawRotString
  43. #endif
  44. extern int XAffDrawAffString (Display *dpy, Drawable drawable, GC gc, XFontStruct *font, int x, int y, double a[4], const char *text);
  45. extern int XAffDrawRotString (Display *dpy, Drawable drawable, GC gc, XFontStruct *font, int x, int y, double angle, const char *text);