]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | /* |
2 | ****************************************************************************** * | |
3 | * | |
4 | * Copyright (C) 1999-2003, International Business Machines | |
5 | * Corporation and others. All Rights Reserved. | |
6 | * | |
7 | ****************************************************************************** * | |
8 | * file name: cmaps.h | |
9 | * | |
10 | * created on: ??/??/2001 | |
11 | * created by: Eric R. Mader | |
12 | */ | |
13 | ||
14 | #ifndef __CMAPS_H | |
15 | #define __CMAPS_H | |
16 | ||
17 | #include "layout/LETypes.h" | |
18 | #include "sfnt.h" | |
19 | ||
20 | class CMAPMapper | |
21 | { | |
22 | public: | |
23 | virtual LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const = 0; | |
24 | ||
25 | virtual ~CMAPMapper(); | |
26 | ||
27 | static CMAPMapper *createUnicodeMapper(const CMAPTable *cmap); | |
28 | ||
29 | protected: | |
30 | CMAPMapper(const CMAPTable *cmap); | |
31 | ||
32 | CMAPMapper() {}; | |
33 | ||
34 | private: | |
35 | const CMAPTable *fcmap; | |
36 | }; | |
37 | ||
38 | class CMAPFormat4Mapper : public CMAPMapper | |
39 | { | |
40 | public: | |
41 | CMAPFormat4Mapper(const CMAPTable *cmap, const CMAPFormat4Encoding *header); | |
42 | ||
43 | virtual ~CMAPFormat4Mapper(); | |
44 | ||
45 | virtual LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const; | |
46 | ||
47 | protected: | |
48 | CMAPFormat4Mapper() {}; | |
49 | ||
50 | private: | |
51 | le_uint16 fEntrySelector; | |
52 | le_uint16 fRangeShift; | |
53 | const le_uint16 *fEndCodes; | |
54 | const le_uint16 *fStartCodes; | |
55 | const le_uint16 *fIdDelta; | |
56 | const le_uint16 *fIdRangeOffset; | |
57 | }; | |
58 | ||
59 | class CMAPGroupMapper : public CMAPMapper | |
60 | { | |
61 | public: | |
62 | CMAPGroupMapper(const CMAPTable *cmap, const CMAPGroup *groups, le_uint32 nGroups); | |
63 | ||
64 | virtual ~CMAPGroupMapper(); | |
65 | ||
66 | virtual LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const; | |
67 | ||
68 | protected: | |
69 | CMAPGroupMapper() {}; | |
70 | ||
71 | private: | |
72 | le_int32 fPower; | |
73 | le_int32 fRangeOffset; | |
74 | const CMAPGroup *fGroups; | |
75 | }; | |
76 | ||
77 | inline CMAPMapper::CMAPMapper(const CMAPTable *cmap) | |
78 | : fcmap(cmap) | |
79 | { | |
80 | // nothing else to do | |
81 | } | |
82 | ||
83 | inline CMAPMapper::~CMAPMapper() | |
84 | { | |
85 | LE_DELETE_ARRAY(fcmap); | |
86 | } | |
87 | ||
88 | #endif | |
89 |