home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / g / gs252src.zip / GS252 / GSTYPE1.H < prev    next >
C/C++ Source or Header  |  1992-05-11  |  4KB  |  113 lines

  1. /* Copyright (C) 1990, 1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* gstype1.h */
  21. /* Client interface to Adobe Type 1 font routines for Ghostscript library */
  22.  
  23. /* ------ Normal client interface ------ */
  24.  
  25. #define crypt_charstring_seed 4330
  26. typedef struct gs_type1_state_s gs_type1_state;
  27. extern const uint gs_type1_state_sizeof;
  28. #ifndef gs_show_enum_s_DEFINED
  29. struct gs_show_enum_s;
  30. #endif
  31. #ifndef gs_type1_data_s_DEFINED
  32. struct gs_type1_data_s;
  33. #endif
  34. int gs_type1_init(P5(gs_type1_state *pis, struct gs_show_enum_s *penum,
  35.           int charpath_flag, int paint_type,
  36.           struct gs_type1_data_s *pdata));
  37. /* Continue interpreting a Type 1 CharString. */
  38. /* If str != 0, it is taken as the byte string to interpret. */
  39. /* Return 0 on successful completion, <0 on error, */
  40. /* or >0 when client intervention is required. */
  41. /* The int * argument is where the character is stored for seac, */
  42. /* or the othersubr # for callothersubr. */
  43. #define type1_result_seac 1
  44. #define type1_result_callothersubr 2
  45. int gs_type1_interpret(P3(gs_type1_state *, const byte *, int *));
  46. /* Pop a (fixed) number off the internal stack */
  47. int gs_type1_pop(P2(gs_type1_state *, fixed *));
  48.  
  49. /* ------ CharString representation ------ */
  50.  
  51. /* Define the charstring command set */
  52. typedef enum {
  53.         c_undef0 = 0,
  54.     c_hstem = 1,
  55.         c_undef2 = 2,
  56.     c_vstem = 3,
  57.     c_vmoveto = 4,
  58.     c_rlineto = 5,
  59.     c_hlineto = 6,
  60.     c_vlineto = 7,
  61.     c_rrcurveto = 8,
  62.     c_closepath = 9,
  63.     c_callsubr = 10,
  64.     c_return = 11,
  65.     c_escape = 12,            /* extends the command set */
  66.     c_hsbw = 13,
  67.     c_endchar = 14,
  68.     c_undoc15 = 15,            /* Undocumented by Adobe, */
  69.                     /* but used in some Adobe fonts. */
  70.         c_undef16 = 16,
  71.         c_undef17 = 17,
  72.         c_undef18 = 18,
  73.         c_undef19 = 19,
  74.         c_undef20 = 20,
  75.     c_rmoveto = 21,
  76.     c_hmoveto = 22,
  77.         c_undef23 = 23,
  78.         c_undef24 = 24,
  79.         c_undef25 = 25,
  80.         c_undef26 = 26,
  81.         c_undef27 = 27,
  82.         c_undef28 = 28,
  83.         c_undef29 = 29,
  84.     c_vhcurveto = 30,
  85.     c_hvcurveto = 31
  86. } char_command;
  87. typedef enum {                /* extended commands */
  88.     ce_dotsection = 0,
  89.     ce_vstem3 = 1,
  90.     ce_hstem3 = 2,
  91.     ce_seac = 6,
  92.     ce_sbw = 7,
  93.     ce_div = 12,
  94.     ce_undoc15 = 15,        /* Undocumented by Adobe, */
  95.                     /* but used in some Adobe fonts. */
  96.     ce_callothersubr = 16,
  97.     ce_pop = 17,
  98.     ce_setcurrentpoint = 33
  99. } char_extended_command;
  100.  
  101. /* Define the encoding of numbers */
  102. #define c_num1 32
  103. #define c_value_num1(ch) ((int)(byte)(ch) - 139)
  104. #define c_num2 247
  105. #define c_value_num2(c1,c2)\
  106.   (((int)(byte)((c1) - c_num2) << 8) + (int)(byte)(c2) + 108)
  107. #define c_num3 251
  108. #define c_value_num3(c1,c2)\
  109.   -(((int)(byte)((c1) - c_num3) << 8) + (int)(byte)(c2) + 108)
  110. /* Otherwise, the first byte is 255, followed by a 32-bit 2's complement */
  111. /* number in big-endian order. */
  112. #define c_num4 255
  113.