1
//========================================================================
3
// P2PCharCodeToUnicode.h
4
// Mapping from character codes to Unicode.
7
// Based Poppler CharCodeToUnicode.h
8
// Copyright 2001-2003 Glyph & Cog, LLC
10
//========================================================================
12
#ifndef P2PCHARCODETOUNICODE_H
13
#define P2PCHARCODETOUNICODE_H
15
#ifdef USE_GCC_PRAGMAS
19
#include "CharTypes.h"
21
struct P2PCharCodeToUnicodeString;
23
//------------------------------------------------------------------------
25
class P2PCharCodeToUnicode {
28
// Parse a ToUnicode CMap for an 8- or 16-bit font from File
29
static P2PCharCodeToUnicode *parseCMapFromFile(GooString *fileName,
32
~P2PCharCodeToUnicode();
34
// Map a CharCode to Unicode.
35
int mapToUnicode(CharCode c, Unicode *u, int size);
37
// Return the mapping's length, i.e., one more than the max char
38
// code supported by the mapping.
39
CharCode getLength() { return mapLen; }
43
void parseCMap1(int (*getCharFunc)(void *), void *data, int nBits);
44
void addMapping(CharCode code, char *uStr, int n, int offset);
45
P2PCharCodeToUnicode();
48
P2PCharCodeToUnicodeString *sMap;
49
int sMapLen, sMapSize;