From 835e373b3eeaabcd0621ed6798ab500f37982fae Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Wed, 5 Apr 2023 14:13:39 -0400 Subject: xpdf-no-select-disable --- xpdf/UnicodeRemapping.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 xpdf/UnicodeRemapping.h (limited to 'xpdf/UnicodeRemapping.h') diff --git a/xpdf/UnicodeRemapping.h b/xpdf/UnicodeRemapping.h new file mode 100644 index 0000000..dbf435e --- /dev/null +++ b/xpdf/UnicodeRemapping.h @@ -0,0 +1,53 @@ +//======================================================================== +// +// UnicodeRemapping.h +// +// Sparse remapping of Unicode characters. +// +// Copyright 2018 Glyph & Cog, LLC +// +//======================================================================== + +#ifndef UNICODEREMAPPING_H +#define UNICODEREMAPPING_H + +#include + +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + +#include "CharTypes.h" + +struct UnicodeRemappingString; + +//------------------------------------------------------------------------ + +class UnicodeRemapping { +public: + + // Create an empty (i.e., identity) remapping. + UnicodeRemapping(); + + ~UnicodeRemapping(); + + // Add a remapping for . + void addRemapping(Unicode in, Unicode *out, int len); + + // Add entries from the specified file to this UnicodeRemapping. + void parseFile(GString *fileName); + + // Map to zero or more (up to ) output characters in + // . Returns the number of output characters. + int map(Unicode in, Unicode *out, int size); + +private: + + int findSMap(Unicode u); + + Unicode page0[256]; + UnicodeRemappingString *sMap; + int sMapLen, sMapSize; +}; + +#endif -- cgit v1.2.3