home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / program / gs300sr1 / gs300sr1.exe / CCFONT.H < prev    next >
C/C++ Source or Header  |  1994-07-27  |  3KB  |  76 lines

  1. /* Copyright (C) 1992, 1994 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* ccfont.h */
  20. /* Header for fonts compiled into C. */
  21.  
  22. #ifndef ccfont_INCLUDED
  23. #  define ccfont_INCLUDED
  24.  
  25. /* Include all the things a compiled font needs. */
  26. #include "std.h"
  27. #include "gsmemory.h"
  28. #include "iref.h"
  29. #include "store.h"
  30.  
  31. /* Define type-specific refs for initializing arrays. */
  32. #define ref_(t) struct { struct tas_s tas; t value; }
  33. #define boolean_v(b) { {t_boolean<<r_type_shift}, (ushort)(b) }
  34. #define integer_v(i) { {t_integer<<r_type_shift}, (long)(i) }
  35. #define null_v() { {t_null<<r_type_shift} }
  36. #define real_v(v) { {t_real<<r_type_shift}, (float)(v) }
  37.  
  38. /* Define other initialization structures. */
  39. typedef struct { byte encx, charx; } charindex;
  40. /* Arrays of strings/names/nulls are represented by byte strings, */
  41. /* containing two bytes of big-endian string length (255,255=null) */
  42. /* followed by the string characters. */
  43. typedef const char *cfont_string_array;
  44.  
  45. /* Support routines in iccfont.c */
  46. typedef struct {
  47.     const charindex *enc_keys;    /* keys from encoding vectors */
  48.     uint num_enc_keys;
  49.     uint num_str_keys;
  50.     uint extra_slots;        /* (need extra for fonts) */
  51.     uint dict_attrs;        /* protection for dictionary */
  52.     uint value_attrs;        /* protection for values */
  53.                     /* (only used for string dicts) */
  54. } cfont_dict_keys;
  55. /* We pass a procedure vector to the font initialization routine */
  56. /* to avoid having externs, which compromise sharability. */
  57. /* On MS-DOS, each compiled font has its own data segment, */
  58. /* so all of these procedures must be declared 'huge' for Borland C. */
  59. typedef struct cfont_procs_s {
  60.     int huge (*ref_dict_create)(P4(ref *, const cfont_dict_keys *,
  61.                        cfont_string_array, const ref *));
  62.     int huge (*string_dict_create)(P4(ref *, const cfont_dict_keys *,
  63.                       cfont_string_array,
  64.                       cfont_string_array));
  65.     int huge (*num_dict_create)(P4(ref *, const cfont_dict_keys *,
  66.                        cfont_string_array, const float *));
  67.     int huge (*name_array_create)(P3(ref *, cfont_string_array, int));
  68.     int huge (*string_array_create)(P4(ref *, cfont_string_array,
  69.                        int /*size*/,
  70.                        uint    /*protection*/));
  71.     int huge (*name_create)(P2(ref *, const char *));
  72. } cfont_procs;
  73.  
  74.  
  75. #endif                    /* ccfont_INCLUDED */
  76.