home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / g / gs241j11.zip / INCLUDE.PCF / PCF.H < prev    next >
C/C++ Source or Header  |  1992-04-02  |  3KB  |  83 lines

  1. /*
  2.  * $XConsortium: pcf.h,v 1.1 91/05/10 14:45:47 keith Exp $
  3.  *
  4.  * Copyright 1990 Massachusetts Institute of Technology
  5.  *
  6.  * Permission to use, copy, modify, distribute, and sell this software and its
  7.  * documentation for any purpose is hereby granted without fee, provided that
  8.  * the above copyright notice appear in all copies and that both that
  9.  * copyright notice and this permission notice appear in supporting
  10.  * documentation, and that the name of M.I.T. not be used in advertising or
  11.  * publicity pertaining to distribution of the software without specific,
  12.  * written prior permission.  M.I.T. makes no representations about the
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  17.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
  18.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  20.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  21.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22.  *
  23.  * Author:  Keith Packard, MIT X Consortium
  24.  */
  25.  
  26. #ifndef _PCF_H_
  27. #define _PCF_H_
  28.  
  29. /*
  30.  * Information used to read/write PCF fonts
  31.  */
  32.  
  33. typedef struct _PCFTable {
  34.     CARD32      type;
  35.     CARD32      format;
  36.     CARD32      size;
  37.     CARD32      offset;
  38. }           PCFTableRec, *PCFTablePtr;
  39.  
  40. #define PCF_FILE_VERSION    (('p'<<24)|('c'<<16)|('f'<<8)|1)
  41. #define    PCF_FORMAT_MASK        0xffffff00
  42.  
  43. #define PCF_DEFAULT_FORMAT    0x00000000
  44. #define PCF_INKBOUNDS        0x00000200
  45. #define PCF_ACCEL_W_INKBOUNDS    0x00000100
  46. #define PCF_COMPRESSED_METRICS    0x00000100
  47.  
  48. #define PCF_FORMAT_MATCH(a,b) (((a)&PCF_FORMAT_MASK) == ((b)&PCF_FORMAT_MASK))
  49.  
  50. #define PCF_GLYPH_PAD_MASK    (3<<0)
  51. #define PCF_BYTE_MASK        (1<<2)
  52. #define PCF_BIT_MASK        (1<<3)
  53. #define PCF_SCAN_UNIT_MASK    (3<<4)
  54.  
  55. #define PCF_BYTE_ORDER(f)    (((f) & PCF_BYTE_MASK)?MSBFirst:LSBFirst)
  56. #define PCF_BIT_ORDER(f)    (((f) & PCF_BIT_MASK)?MSBFirst:LSBFirst)
  57. #define PCF_GLYPH_PAD_INDEX(f)    ((f) & PCF_GLYPH_PAD_MASK)
  58. #define PCF_GLYPH_PAD(f)    (1<<PCF_GLYPH_PAD_INDEX(f))
  59. #define PCF_SCAN_UNIT_INDEX(f)    (((f) & PCF_SCAN_UNIT_MASK) >> 4)
  60. #define PCF_SCAN_UNIT(f)    (1<<PCF_SCAN_UNIT_INDEX(f))
  61. #define PCF_FORMAT_BITS(f)    ((f) & (PCF_GLYPH_PAD_MASK|PCF_BYTE_MASK|PCF_BIT_MASK|PCF_SCAN_UNIT_MASK))
  62.  
  63. #define PCF_SIZE_TO_INDEX(s)    ((s) == 4 ? 2 : (s) == 2 ? 1 : 0)
  64. #define PCF_INDEX_TO_SIZE(b)    (1<<b)
  65.  
  66. #define PCF_FORMAT(bit,byte,glyph,scan) (\
  67.     (PCF_SIZE_TO_INDEX(scan) << 4) | \
  68.     (((bit) == MSBFirst ? 1 : 0) << 3) | \
  69.     (((byte) == MSBFirst ? 1 : 0) << 2) | \
  70.     (PCF_SIZE_TO_INDEX(glyph) << 0))
  71.  
  72. #define PCF_PROPERTIES            (1<<0)
  73. #define PCF_ACCELERATORS        (1<<1)
  74. #define PCF_METRICS            (1<<2)
  75. #define PCF_BITMAPS            (1<<3)
  76. #define PCF_INK_METRICS            (1<<4)
  77. #define    PCF_BDF_ENCODINGS        (1<<5)
  78. #define PCF_SWIDTHS            (1<<6)
  79. #define PCF_GLYPH_NAMES            (1<<7)
  80. #define PCF_BDF_ACCELERATORS        (1<<8)
  81.  
  82. #endif                /* _PCF_H_ */
  83.