home *** CD-ROM | disk | FTP | other *** search
- //========================================================================
- //
- // FontEncoding.h
- //
- // Copyright 1999 Derek B. Noonburg
- //
- //========================================================================
- //
- // Ported to EPOC by Sander van der Wal
- //
- // $Id: FontEncoding.h 1.2 2000-09-17 13:38:18+02 svdwal Exp svdwal $
-
- #ifndef FONTENCODING_H
- #define FONTENCODING_H
-
- #ifdef __GNUC__
- #pragma interface
- #endif
-
- #ifndef __E32BASE_H__
- #include <e32base.h>
- #endif
-
- #include "gtypes.h"
-
- //------------------------------------------------------------------------
- // FontEncoding
- //------------------------------------------------------------------------
-
- #define fontEncHashSize 419
-
- class FontEncoding: public CBase {
- public:
-
- FontEncoding() {}
-
- // Construct an empty encoding.
- void ConstructL();
-
- // Construct an encoding from an array of char names.
- void Construct(const char* const encoding[], int size);
-
- // Destructor.
- ~FontEncoding();
-
- // Create a copy of the encoding.
- FontEncoding *copyL();
-
- // Return number of codes in encoding, i.e., max code + 1.
- int getSize() { return size; }
-
- // Add a char to the encoding.
- void addChar(int code, const char *name);
-
- // Return the character name associated with <code>.
- const char *getCharName(int code) { return encoding[code]; }
-
- // Return the code associated with <name>.
- int getCharCode(const char *name) const;
-
- private:
-
- void ConstructL(FontEncoding *fontEnc);
-
- int hash(const char *name) const;
- void addChar1(int code, const char *name);
-
- const char **encoding; // code --> name mapping
- int size; // number of codes
- GBool freeEnc; // should we free the encoding array?
- short // name --> code hash table
- hashTab[fontEncHashSize];
- };
-
- #endif
-