font.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /***********************************************************
  2. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  3. All Rights Reserved
  4. Permission to use, copy, modify, and distribute this software and its
  5. documentation for any purpose and without fee is hereby granted,
  6. provided that the above copyright notice appear in all copies and that
  7. both that copyright notice and this permission notice appear in
  8. supporting documentation, and that the name of Digital not be
  9. used in advertising or publicity pertaining to distribution of the
  10. software without specific, written prior permission.
  11. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  12. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  13. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  14. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  15. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  16. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  17. SOFTWARE.
  18. ******************************************************************/
  19. #ifndef FONT_H
  20. #define FONT_H
  21. #ifndef BitmapFormatByteOrderMask
  22. #include "fsmasks.h"
  23. #endif
  24. /* data structures */
  25. #ifndef _XTYPEDEF_FONTPTR
  26. typedef struct _Font *FontPtr;
  27. #define _XTYPEDEF_FONTPTR
  28. #endif
  29. typedef struct _FontInfo *FontInfoPtr;
  30. typedef struct _FontProp *FontPropPtr;
  31. typedef struct _ExtentInfo *ExtentInfoPtr;
  32. typedef struct _FontPathElement *FontPathElementPtr;
  33. #ifndef _XTYPEDEF_CHARINFOPTR
  34. typedef struct _CharInfo *CharInfoPtr;
  35. #define _XTYPEDEF_CHARINFOPTR
  36. #endif
  37. typedef struct _FontNames *FontNamesPtr;
  38. typedef struct _FontResolution *FontResolutionPtr;
  39. #define NullCharInfo ((CharInfoPtr) 0)
  40. #define NullFont ((FontPtr) 0)
  41. #define NullFontInfo ((FontInfoPtr) 0)
  42. /* draw direction */
  43. #define LeftToRight 0
  44. #define RightToLeft 1
  45. #define BottomToTop 2
  46. #define TopToBottom 3
  47. typedef int DrawDirection;
  48. #define NO_SUCH_CHAR -1
  49. #define FontAliasType 0x1000
  50. #define AllocError 80
  51. #define StillWorking 81
  52. #define FontNameAlias 82
  53. #define BadFontName 83
  54. #define Suspended 84
  55. #define Successful 85
  56. #define BadFontPath 86
  57. #define BadCharRange 87
  58. #define BadFontFormat 88
  59. #define FPEResetFailed 89 /* for when an FPE reset won't work */
  60. /* OpenFont flags */
  61. #define FontLoadInfo 0x0001
  62. #define FontLoadProps 0x0002
  63. #define FontLoadMetrics 0x0004
  64. #define FontLoadBitmaps 0x0008
  65. #define FontLoadAll 0x000f
  66. #define FontOpenSync 0x0010
  67. #define FontReopen 0x0020
  68. /* Query flags */
  69. #define LoadAll 0x1
  70. #define FinishRamge 0x2
  71. #define EightBitFont 0x4
  72. #define SixteenBitFont 0x8
  73. /* Glyph Caching Modes */
  74. #define CACHING_OFF 0
  75. #define CACHE_16_BIT_GLYPHS 1
  76. #define CACHE_ALL_GLYPHS 2
  77. #define DEFAULT_GLYPH_CACHING_MODE CACHE_16_BIT_GLYPHS
  78. extern int glyphCachingMode;
  79. struct _Client;
  80. extern int StartListFontsWithInfo(
  81. struct _Client * /*client*/,
  82. int /*length*/,
  83. unsigned char * /*pattern*/,
  84. int /*max_names*/
  85. );
  86. extern FontNamesPtr MakeFontNamesRecord(
  87. unsigned /* size */
  88. );
  89. extern void FreeFontNames(
  90. FontNamesPtr /* pFN*/
  91. );
  92. extern int AddFontNamesName(
  93. FontNamesPtr /* names */,
  94. char * /* name */,
  95. int /* length */
  96. );
  97. #if 0 /* unused */
  98. extern int FontToFSError();
  99. extern FontResolutionPtr GetClientResolution();
  100. #endif
  101. typedef struct _FontPatternCache *FontPatternCachePtr;
  102. extern FontPatternCachePtr MakeFontPatternCache (
  103. void
  104. );
  105. extern void FreeFontPatternCache (
  106. FontPatternCachePtr /* cache */
  107. );
  108. extern void EmptyFontPatternCache (
  109. FontPatternCachePtr /* cache */
  110. );
  111. extern void CacheFontPattern (
  112. FontPatternCachePtr /* cache */,
  113. const char * /* pattern */,
  114. int /* patlen */,
  115. FontPtr /* pFont */
  116. );
  117. extern FontResolutionPtr GetClientResolutions(
  118. int * /* num */
  119. );
  120. extern FontPtr FindCachedFontPattern (
  121. FontPatternCachePtr /* cache */,
  122. const char * /* pattern */,
  123. int /* patlen */
  124. );
  125. extern void RemoveCachedFontPattern (
  126. FontPatternCachePtr /* cache */,
  127. FontPtr /* pFont */
  128. );
  129. typedef enum {
  130. Linear8Bit, TwoD8Bit, Linear16Bit, TwoD16Bit
  131. } FontEncoding;
  132. #endif /* FONT_H */