g_control.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. /* Control codes (used internally when rendering a label, i.e. a
  16. user-specified text string). The header file is #include'd by
  17. g_cntrlify.c, and g_alabel_her.c (which renders labels in Hershey
  18. fonts), and by the generic renderer g_alabel.c. */
  19. /* the order of these must agree with the order in g_cntrlify.h */
  20. #define C_BEGIN_SUPERSCRIPT 0
  21. #define C_END_SUPERSCRIPT 1
  22. #define C_BEGIN_SUBSCRIPT 2
  23. #define C_END_SUBSCRIPT 3
  24. #define C_PUSH_LOCATION 4
  25. #define C_POP_LOCATION 5
  26. #define C_RIGHT_ONE_EM 6
  27. #define C_RIGHT_HALF_EM 7
  28. #define C_RIGHT_QUARTER_EM 8
  29. #define C_RIGHT_SIXTH_EM 9
  30. #define C_RIGHT_EIGHTH_EM 10
  31. #define C_RIGHT_TWELFTH_EM 11
  32. #define C_LEFT_ONE_EM 12
  33. #define C_LEFT_HALF_EM 13
  34. #define C_LEFT_QUARTER_EM 14
  35. #define C_LEFT_SIXTH_EM 15
  36. #define C_LEFT_EIGHTH_EM 16
  37. #define C_LEFT_TWELFTH_EM 17
  38. #define C_RIGHT_RADICAL_SHIFT 254 /* for \rn in PS and PCL fonts */
  39. #define C_LEFT_RADICAL_SHIFT 255
  40. #define PS_RADICAL_WIDTH 0.515 /* shifts to make radical, radicalex line up */
  41. #define PCL_RADICAL_WIDTH 0.080
  42. #define RADICALEX 96
  43. /* flags in each unsigned short in a `controlified' text string (mutually
  44. exclusive) */
  45. #define CONTROL_CODE 0x8000
  46. #define RAW_HERSHEY_GLYPH 0x4000
  47. #define RAW_ORIENTAL_HERSHEY_GLYPH 0x2000
  48. /* masks for extracting, from an unsigned short in a controlified text string,
  49. (1) the font, if none of the above flags is set, or (2) the raw glyph
  50. number, if either of the latter two flags is set */
  51. #define ONE_BYTE 0xff
  52. #define FONT_SHIFT 8
  53. #define FONT_SPEC (ONE_BYTE << FONT_SHIFT)
  54. #define GLYPH_SPEC 0x1fff