home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / appkit / Font.h < prev    next >
Text File  |  1992-07-10  |  3KB  |  105 lines

  1. /*
  2.     Font.h
  3.     Application Kit, Release 2.1J
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #ifndef FONT_H
  8. #define FONT_H
  9.  
  10. #import <objc/Object.h>
  11. #import <objc/hashtable.h>
  12. #import "afm.h"
  13.  
  14. #define NX_IDENTITYMATRIX ((float *) 0)
  15. #define NX_FLIPPEDMATRIX  ((float *) -1)
  16.  
  17. /* 
  18.  * Figure is also known as non-breaking space.
  19.  * NX_EMSPACE, NX_ENSPACE and NX_THINSPACE have been removed as part of
  20.  * the switch to the NextStep encoding.
  21.  */
  22.  
  23. #define NX_FIGSPACE    ((unsigned short)0x80)
  24.  
  25. typedef struct _NXFaceInfo {
  26.     NXFontMetrics      *fontMetrics;        /* Information from afm file */
  27.     int                 flags;            /* Which font info is present */
  28.     struct _fontFlags {                /* Keep track of font usage
  29.                          * for Conforming PS comments */
  30.     unsigned int        usedInDoc:1;    /* has font been used in doc? */
  31.     unsigned int        usedInPage:1;   /* has font been used in page? */
  32.     unsigned int        usedInSheet:1;  /* has font been used in sheet? */
  33.     unsigned int        _PADDING:13;
  34.     }                   fontFlags;
  35.     struct _NXFaceInfo *nextFInfo;        /* next faceInfo in the list */
  36. } NXFaceInfo;
  37.  
  38. @interface Font : Object
  39. {
  40.     NXAtom              name;
  41.     float UE          size;
  42.     int                 style;
  43.     float              *matrix;
  44.     int                 fontNum;
  45.     NXFaceInfo         *faceInfo;
  46.     id                  otherFont;
  47.     struct _fFlags {
  48.       /* the following two instance variables are no longer part of the API */
  49.     unsigned int        usedByWS:1;
  50.     unsigned int        usedByPrinter:1;
  51.     unsigned int        isScreenFont:1;
  52.     unsigned int        _systemFontType:4;
  53.     unsigned int        _RESERVED:6;
  54.     unsigned int        _matrixIsIdentity:1;
  55.     unsigned int        _matrixIsFlipped:1;
  56.     unsigned int        _hasStyle:1;
  57.     }                   fFlags;
  58.     unsigned short      _reservedFont2;
  59.     unsigned int        _reservedFont3;
  60. }
  61.  
  62. + initialize;
  63. + allocFromZone:(NXZone *)zone;
  64. + newFont:(const char *)fontName size:(float)fontSize style:(int)fontStyle matrix:(const float *)fontMatrix;
  65. + newFont:(const char *)fontName size:(float)fontSize;
  66. + newFont:(const char *)fontName size:(float)fontSize matrix:(const float *)fontMatrix;
  67. + useFont:(const char *)fontName;
  68.  
  69. + userFontOfSize:(float)fontSize matrix:(const float *)fontMatrix;
  70. + userFixedPitchFontOfSize:(float)fontSize matrix:(const float *)fontMatrix;
  71. + systemFontOfSize:(float)fontSize matrix:(const float *)fontMatrix;
  72. + boldSystemFontOfSize:(float)fontSize matrix:(const float *)fontMatrix;
  73. + setUserFont:(Font *)aFont;
  74. + setUserFixedPitchFont:(Font *)aFont;
  75.  
  76. - awake;
  77. - free;
  78. - (float)pointSize;
  79. - (const char *)name;
  80. - (const char *)familyName;
  81. - (const char *)displayName;
  82. - (int)fontNum;
  83. - (int)style;
  84. - setStyle:(int)aStyle;
  85. - (const float *)matrix;
  86. - (NXFontMetrics *)metrics;
  87. - (NXFontMetrics *)readMetrics:(int)flags;
  88. - (BOOL)hasMatrix;
  89. - set;
  90. - (float)getWidthOf:(const char *)string;
  91. - screenFont;
  92. - finishUnarchiving;
  93. - write:(NXTypedStream *)stream;
  94. - read:(NXTypedStream *)stream;
  95.  
  96. #ifdef KANJI
  97. - (int)mappingScheme;
  98. - (BOOL)isBaseFont;
  99. - (char *)characterSet;
  100. #endif KANJI
  101.  
  102. @end
  103.  
  104. #endif FONT_H
  105.