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 / CCFONT.H < prev    next >
C/C++ Source or Header  |  1992-08-18  |  3KB  |  72 lines

  1. /* Copyright (C) 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. /* ccfont.h */
  21. /* Header for fonts compiled into C. */
  22.  
  23. /* Define type-specific refs for initializing arrays. */
  24. #define ref_(t) struct { struct tas_s tas; t value; }
  25. #define boolean_v(b) { {t_boolean<<r_type_shift}, (ushort)(b) }
  26. #define integer_v(i) { {t_integer<<r_type_shift}, (long)(i) }
  27. #define null_v() { {t_null<<r_type_shift} }
  28. #define real_v(v) { {t_real<<r_type_shift}, (float)(v) }
  29.  
  30. /* Define ref creation macros. */
  31. #include "store.h"
  32. #define make_array(pref,attrs,size,elts)\
  33.   make_tasv(pref,t_array,attrs,size,refs,elts)
  34. #define make_string(pref,attrs,size,chars)\
  35.   make_tasv(pref,t_string,attrs,size,const_bytes,chars)
  36.  
  37. /* Define other initialization structures. */
  38. typedef struct { byte encx, charx; } charindex;
  39. /* Arrays of strings/names/nulls are represented by byte strings, */
  40. /* containing two bytes of big-endian string length (255,255=null) */
  41. /* followed by the string characters. */
  42. typedef const char *cfont_string_array;
  43.  
  44. /* Support routines in iccfont.c */
  45. typedef struct {
  46.     const charindex *enc_keys;    /* keys from encoding vectors */
  47.     uint num_enc_keys;
  48.     uint num_str_keys;
  49.     uint extra_slots;        /* (need 1 extra for fonts) */
  50.     uint dict_attrs;        /* protection for dictionary */
  51.     uint value_attrs;        /* protection for values */
  52.                     /* (only used for string dicts) */
  53. } cfont_dict_keys;
  54. /* We pass a procedure vector to the font initialization routine */
  55. /* to avoid having externs, which compromise sharability. */
  56. /* On MS-DOS, each compiled font has its own data segment, */
  57. /* so all of these procedures must be declared 'huge' for Borland C. */
  58. typedef struct cfont_procs_s {
  59.     int huge (*ref_dict_create)(P4(ref *, const cfont_dict_keys *,
  60.                        cfont_string_array, const ref *));
  61.     int huge (*string_dict_create)(P4(ref *, const cfont_dict_keys *,
  62.                       cfont_string_array,
  63.                       cfont_string_array));
  64.     int huge (*num_dict_create)(P4(ref *, const cfont_dict_keys *,
  65.                        cfont_string_array, const float *));
  66.     int huge (*name_array_create)(P3(ref *, cfont_string_array, int));
  67.     int huge (*string_array_create)(P4(ref *, cfont_string_array,
  68.                        int /*size*/,
  69.                        uint /*protection*/));
  70.     int huge (*name_create)(P2(ref *, const char *));
  71. } cfont_procs;
  72.