home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C ++ / Applications / Pict2Ascii 1.03 / Src / FontLight.h < prev    next >
Encoding:
Text File  |  1997-05-19  |  1.3 KB  |  59 lines  |  [TEXT/CWIE]

  1. // =================================================================================
  2. //    FontLight.h                                        ©1997 BB's Team inc. All rights reserved
  3. // =================================================================================
  4.  
  5. #pragma once
  6.  
  7. #include "PLConstants.h"
  8. #include <UTextTraits.h>
  9. #include <LString.h>
  10.  
  11. typedef struct FontPair {
  12.     unsigned char    glyph;
  13.     float                value;
  14. } FontPair, *FontPairPtr;
  15.  
  16. class FontLight {
  17.  
  18.     public:
  19.         static const Rect    nullRect;
  20.         enum {
  21.             kMissing   = -10000,
  22.             kForbidden = -20000
  23.         };
  24.  
  25.                                 FontLight (void);
  26.         virtual                 ~FontLight();
  27.         void                    SetTextTraits (const TextTraitsRecord &);
  28.         void                    SetRect (Rect);
  29.         void                    SetScreen (Boolean);
  30.         void                    Set7Bits (Boolean in7Bits);
  31.  
  32.         void                    Update (void);
  33.         Boolean                IsUpToDate (void);
  34.         char                    ComputeChar (float);
  35.         void                    GetMinMax (float &fMin, float &fMax);
  36.         void                    SetAllowed (LStr255);
  37.         LStr255                GetAllowed ();
  38.  
  39.     protected:
  40.         void                    InitPairs (void);
  41.         void                    SortPairs (void);
  42.         
  43.         Int32                    mFirstChar, mLastChar;
  44.         Int32                    mFirstEntry, mLastEntry;
  45.         Boolean                m7Bits;
  46.         Boolean                mUpToDate;
  47.         Boolean                mForScreen;
  48.         Rect                    mRect;
  49.         FontPair                mPair[256];
  50.         LStr255                mAllowed;
  51.         TextTraitsRecord    mTextTraits;
  52.  
  53. };
  54.  
  55.  
  56. // sort "C-style" comparison function
  57. Boolean ComparePairs (const FontPair &a, const FontPair &b);
  58.  
  59.