Permalink
Browse files

Verified and corrected unicode UTF8 issues.

Got back to using the old class names, before the "name collision" change.
To solve the few cases i did get collisions (EStatusCode and DocumentContext)
i preferred starting to use a new namespace named PDFHummus. i'll add more
classes to it in the future.
  • Loading branch information...
1 parent 0dab1d4 commit ef610c3f6e6ed53df50eb1bb0a71575c13cdd2d3 @galkahana committed Aug 13, 2011
Showing with 5,255 additions and 5,304 deletions.
  1. +5 −4 PDFWriter/ANSIFontWriter.cpp
  2. +2 −2 PDFWriter/ANSIFontWriter.h
  3. +27 −25 PDFWriter/AbstractContentContext.cpp
  4. +12 −12 PDFWriter/AbstractContentContext.h
  5. +14 −13 PDFWriter/AbstractWrittenFont.cpp
  6. +7 −7 PDFWriter/AbstractWrittenFont.h
  7. +7 −5 PDFWriter/CFFANSIFontWriter.cpp
  8. +2 −2 PDFWriter/CFFANSIFontWriter.h
  9. +6 −4 PDFWriter/CFFDescendentFontWriter.cpp
  10. +1 −1 PDFWriter/CFFDescendentFontWriter.h
  11. +67 −65 PDFWriter/CFFEmbeddedFontWriter.cpp
  12. +21 −21 PDFWriter/CFFEmbeddedFontWriter.h
  13. +151 −149 PDFWriter/CFFFileInput.cpp
  14. +37 −37 PDFWriter/CFFFileInput.h
  15. +80 −77 PDFWriter/CFFPrimitiveReader.cpp
  16. +18 −18 PDFWriter/CFFPrimitiveReader.h
  17. +108 −106 PDFWriter/CFFPrimitiveWriter.cpp
  18. +22 −22 PDFWriter/CFFPrimitiveWriter.h
  19. +6 −5 PDFWriter/CIDFontWriter.cpp
  20. +2 −2 PDFWriter/CIDFontWriter.h
  21. +149 −147 PDFWriter/CharStringType1Interpreter.cpp
  22. +31 −31 PDFWriter/CharStringType1Interpreter.h
  23. +56 −54 PDFWriter/CharStringType1Tracer.cpp
  24. +28 −28 PDFWriter/CharStringType1Tracer.h
  25. +99 −97 PDFWriter/CharStringType2Flattener.cpp
  26. +55 −55 PDFWriter/CharStringType2Flattener.h
  27. +111 −110 PDFWriter/CharStringType2Interpreter.cpp
  28. +3 −3 PDFWriter/CharStringType2Interpreter.h
  29. +98 −96 PDFWriter/CharStringType2Tracer.cpp
  30. +49 −49 PDFWriter/CharStringType2Tracer.h
  31. +5 −3 PDFWriter/DescendentFontWriter.cpp
  32. +2 −2 PDFWriter/DescendentFontWriter.h
  33. +5 −3 PDFWriter/DictionaryContext.cpp
  34. +2 −2 PDFWriter/DictionaryContext.h
  35. +137 −135 PDFWriter/{DocumentsContext.cpp → DocumentContext.cpp}
  36. +264 −0 PDFWriter/DocumentContext.h
  37. +45 −45 PDFWriter/{DocumentsContextExtenderAdapter.h → DocumentContextExtenderAdapter.h}
  38. +0 −261 PDFWriter/DocumentsContext.h
  39. +8 −5 PDFWriter/{EPDFStatusCode.h → EStatusCode.h}
  40. +11 −9 PDFWriter/FreeTypeFaceWrapper.cpp
  41. +3 −3 PDFWriter/FreeTypeFaceWrapper.h
  42. +1 −1 PDFWriter/FreeTypeType1Wrapper.cpp
  43. +9 −6 PDFWriter/FreeTypeWrapper.cpp
  44. +2 −2 PDFWriter/FreeTypeWrapper.h
  45. +5 −3 PDFWriter/GraphicStateStack.cpp
  46. +2 −2 PDFWriter/GraphicStateStack.h
  47. +0 −490 PDFWriter/HummusPDFWriter.cpp
  48. +2 −2 PDFWriter/IDescendentFontWriter.h
  49. +41 −35 PDFWriter/{IDocumentsContextExtender.h → IDocumentContextExtender.h}
  50. +51 −51 PDFWriter/IType1InterpreterImplementation.h
  51. +96 −96 PDFWriter/IType2InterpreterImplementation.h
  52. +5 −5 PDFWriter/IWrittenFont.h
  53. +12 −10 PDFWriter/IndirectObjectsReferenceRegistry.cpp
  54. +5 −5 PDFWriter/IndirectObjectsReferenceRegistry.h
  55. +1 −1 PDFWriter/InputBufferedStream.h
  56. +8 −5 PDFWriter/InputCharStringDecodeStream.cpp
  57. +2 −2 PDFWriter/InputCharStringDecodeStream.h
  58. +9 −7 PDFWriter/InputFile.cpp
  59. +3 −3 PDFWriter/InputFile.h
  60. +6 −4 PDFWriter/InputFileStream.cpp
  61. +3 −3 PDFWriter/InputFileStream.h
  62. +1 −1 PDFWriter/InputFlateDecodeStream.h
  63. +58 −56 PDFWriter/InputPFBDecodeStream.cpp
  64. +12 −12 PDFWriter/InputPFBDecodeStream.h
  65. +33 −30 PDFWriter/JPEGImageHandler.cpp
  66. +16 −9 PDFWriter/JPEGImageHandler.h
  67. +76 −74 PDFWriter/JPEGImageParser.cpp
  68. +17 −17 PDFWriter/JPEGImageParser.h
  69. +4 −3 PDFWriter/MD5Generator.cpp
  70. +2 −2 PDFWriter/MD5Generator.h
  71. +15 −13 PDFWriter/ObjectsContext.cpp
  72. +6 −6 PDFWriter/ObjectsContext.h
  73. +42 −40 PDFWriter/OpenTypeFileInput.cpp
  74. +14 −14 PDFWriter/OpenTypeFileInput.h
  75. +72 −70 PDFWriter/OpenTypePrimitiveReader.cpp
  76. +13 −13 PDFWriter/OpenTypePrimitiveReader.h
  77. +9 −7 PDFWriter/OutputFile.cpp
  78. +3 −3 PDFWriter/OutputFile.h
  79. +6 −5 PDFWriter/OutputFileStream.cpp
  80. +3 −3 PDFWriter/OutputFileStream.h
  81. +8 −6 PDFWriter/OutputStreamTraits.cpp
  82. +3 −3 PDFWriter/OutputStreamTraits.h
  83. +17 −15 PDFWriter/PDFDocumentCopyingContext.cpp
  84. +22 −16 PDFWriter/PDFDocumentCopyingContext.h
  85. +312 −311 PDFWriter/PDFDocumentHandler.cpp
  86. +69 −64 PDFWriter/PDFDocumentHandler.h
  87. +4 −4 PDFWriter/PDFEmbedParameterTypes.h
  88. +60 −58 PDFWriter/{PDFObjectsParser.cpp → PDFObjectParser.cpp}
  89. +5 −5 PDFWriter/{PDFObjectsParser.h → PDFObjectParser.h}
  90. +257 −256 PDFWriter/{HummusPDFParser.cpp → PDFParser.cpp}
  91. +31 −31 PDFWriter/{HummusPDFParser.h → PDFParser.h}
  92. +15 −13 PDFWriter/PDFParserTokenizer.cpp
  93. +2 −2 PDFWriter/PDFParserTokenizer.h
  94. +1 −1 PDFWriter/PDFStream.h
  95. +2 −2 PDFWriter/PDFTextString.cpp
  96. +16 −14 PDFWriter/PDFUsedFont.cpp
  97. +8 −8 PDFWriter/PDFUsedFont.h
  98. +492 −0 PDFWriter/PDFWriter.cpp
  99. +31 −31 PDFWriter/{HummusPDFWriter.h → PDFWriter.h}
  100. +17 −17 PDFWriter/PDFWriter.vcproj
  101. +11 −11 PDFWriter/PDFWriter.vcxproj
  102. +19 −19 PDFWriter/PDFWriter.vcxproj.filters
  103. +31 −29 PDFWriter/PFMFileReader.cpp
  104. +9 −9 PDFWriter/PFMFileReader.h
  105. +7 −4 PDFWriter/PageContentContext.cpp
  106. +2 −2 PDFWriter/PageContentContext.h
  107. +1 −1 PDFWriter/SafeBufferMacrosDefs.h
  108. +9 −7 PDFWriter/StateReader.cpp
  109. +5 −5 PDFWriter/StateReader.h
  110. +8 −7 PDFWriter/StateWriter.cpp
  111. +3 −3 PDFWriter/StateWriter.h
  112. +96 −94 PDFWriter/TIFFImageHandler.cpp
  113. +21 −14 PDFWriter/TIFFImageHandler.h
  114. +6 −4 PDFWriter/TrueTypeANSIFontWriter.cpp
  115. +2 −2 PDFWriter/TrueTypeANSIFontWriter.h
  116. +5 −3 PDFWriter/TrueTypeDescendentFontWriter.cpp
  117. +1 −1 PDFWriter/TrueTypeDescendentFontWriter.h
  118. +39 −38 PDFWriter/TrueTypeEmbeddedFontWriter.cpp
  119. +18 −18 PDFWriter/TrueTypeEmbeddedFontWriter.h
  120. +30 −28 PDFWriter/TrueTypePrimitiveWriter.cpp
  121. +9 −9 PDFWriter/TrueTypePrimitiveWriter.h
  122. +54 −52 PDFWriter/Type1Input.cpp
  123. +14 −14 PDFWriter/Type1Input.h
  124. +48 −46 PDFWriter/Type1ToCFFEmbeddedFontWriter.cpp
  125. +16 −16 PDFWriter/Type1ToCFFEmbeddedFontWriter.h
  126. +51 −49 PDFWriter/Type1ToType2Converter.cpp
  127. +31 −31 PDFWriter/Type1ToType2Converter.h
  128. +32 −30 PDFWriter/Type2CharStringWriter.cpp
  129. +6 −6 PDFWriter/Type2CharStringWriter.h
  130. +56 −54 PDFWriter/UnicodeString.cpp
  131. +15 −15 PDFWriter/UnicodeString.h
  132. +14 −12 PDFWriter/UsedFontsRepository.cpp
  133. +5 −5 PDFWriter/UsedFontsRepository.h
  134. +11 −9 PDFWriter/WrittenFontCFF.cpp
  135. +3 −3 PDFWriter/WrittenFontCFF.h
  136. +11 −9 PDFWriter/WrittenFontTrueType.cpp
  137. +3 −3 PDFWriter/WrittenFontTrueType.h
  138. +12 −11 PDFWriterTestPlayground/AppendPagesTest.cpp
  139. +2 −2 PDFWriterTestPlayground/AppendPagesTest.h
  140. +18 −17 PDFWriterTestPlayground/AppendSpecialPagesTest.cpp
  141. +2 −2 PDFWriterTestPlayground/AppendSpecialPagesTest.h
  142. +12 −11 PDFWriterTestPlayground/BoxingBaseTest.cpp
  143. +3 −3 PDFWriterTestPlayground/BoxingBaseTest.h
  144. +4 −3 PDFWriterTestPlayground/BufferedOutputStreamTest.cpp
  145. +2 −2 PDFWriterTestPlayground/BufferedOutputStreamTest.h
  146. +14 −13 PDFWriterTestPlayground/CustomLogTest.cpp
  147. +1 −1 PDFWriterTestPlayground/CustomLogTest.h
  148. +8 −7 PDFWriterTestPlayground/EmptyFileTest.cpp
  149. +2 −2 PDFWriterTestPlayground/EmptyFileTest.h
  150. +10 −9 PDFWriterTestPlayground/EmptyPagesPDF.cpp
  151. +2 −2 PDFWriterTestPlayground/EmptyPagesPDF.h
  152. +8 −7 PDFWriterTestPlayground/FlateEncryptionTest.cpp
  153. +2 −2 PDFWriterTestPlayground/FlateEncryptionTest.h
  154. +16 −15 PDFWriterTestPlayground/FormXObjectTest.cpp
  155. +2 −2 PDFWriterTestPlayground/FormXObjectTest.h
  156. +13 −12 PDFWriterTestPlayground/FreeTypeInitializationTest.cpp
  157. +4 −4 PDFWriterTestPlayground/FreeTypeInitializationTest.h
  158. +0 −193 PDFWriterTestPlayground/HummusPDFParserTest.cpp
  159. +0 −49 PDFWriterTestPlayground/HummusPDFParserTest.h
  160. +3 −3 PDFWriterTestPlayground/ITestUnit.h
  161. +15 −14 PDFWriterTestPlayground/ImagesAndFormsForwardReferenceTest.cpp
  162. +2 −2 PDFWriterTestPlayground/ImagesAndFormsForwardReferenceTest.h
  163. +5 −4 PDFWriterTestPlayground/InputFlateDecodeTester.cpp
  164. +2 −2 PDFWriterTestPlayground/InputFlateDecodeTester.h
  165. +19 −18 PDFWriterTestPlayground/InputImagesAsStreamsTest.cpp
  166. +1 −1 PDFWriterTestPlayground/InputImagesAsStreamsTest.h
  167. +15 −14 PDFWriterTestPlayground/JPGImageTest.cpp
  168. +2 −2 PDFWriterTestPlayground/JPGImageTest.h
  169. +14 −13 PDFWriterTestPlayground/LinksTest.cpp
  170. +2 −2 PDFWriterTestPlayground/LinksTest.h
  171. +5 −3 PDFWriterTestPlayground/LogTest.cpp
  172. +2 −2 PDFWriterTestPlayground/LogTest.h
  173. +97 −96 PDFWriterTestPlayground/MergePDFPages.cpp
  174. +9 −9 PDFWriterTestPlayground/MergePDFPages.h
  175. +5 −3 PDFWriterTestPlayground/MyTest.cpp
  176. +2 −2 PDFWriterTestPlayground/MyTest.h
  177. +11 −10 PDFWriterTestPlayground/OpenTypeTest.cpp
  178. +4 −4 PDFWriterTestPlayground/OpenTypeTest.h
  179. +4 −3 PDFWriterTestPlayground/OutputFileStreamTest.cpp
  180. +2 −2 PDFWriterTestPlayground/OutputFileStreamTest.h
  181. +13 −12 PDFWriterTestPlayground/PDFCopyingContextTest.cpp
  182. +2 −2 PDFWriterTestPlayground/PDFCopyingContextTest.h
  183. +9 −8 PDFWriterTestPlayground/PDFDateTest.cpp
  184. +2 −2 PDFWriterTestPlayground/PDFDateTest.h
  185. +12 −11 PDFWriterTestPlayground/PDFEmbedTest.cpp
  186. +2 −2 PDFWriterTestPlayground/PDFEmbedTest.h
  187. +8 −7 PDFWriterTestPlayground/PDFObjectCastTest.cpp
  188. +2 −2 PDFWriterTestPlayground/PDFObjectCastTest.h
  189. +20 −19 PDFWriterTestPlayground/PDFParserTest.cpp
  190. +3 −3 PDFWriterTestPlayground/PDFParserTest.h
  191. +8 −7 PDFWriterTestPlayground/PDFTextStringTest.cpp
  192. +2 −2 PDFWriterTestPlayground/PDFTextStringTest.h
  193. +10 −10 PDFWriterTestPlayground/PDFWriterTestPlayground.cpp
  194. +6 −5 PDFWriterTestPlayground/PFBStreamTest.cpp
  195. +2 −2 PDFWriterTestPlayground/PFBStreamTest.h
  196. +27 −26 PDFWriterTestPlayground/RefCountTest.cpp
  197. +2 −2 PDFWriterTestPlayground/RefCountTest.h
  198. +23 −22 PDFWriterTestPlayground/ShutDownRestartTest.cpp
  199. +2 −2 PDFWriterTestPlayground/ShutDownRestartTest.h
  200. +12 −11 PDFWriterTestPlayground/SimpleContentPageTest.cpp
  201. +2 −2 PDFWriterTestPlayground/SimpleContentPageTest.h
  202. +47 −45 PDFWriterTestPlayground/SimpleTextUsage.cpp
  203. +5 −5 PDFWriterTestPlayground/SimpleTextUsage.h
  204. +50 −49 PDFWriterTestPlayground/TIFFImageTest.cpp
  205. +4 −4 PDFWriterTestPlayground/TIFFImageTest.h
  206. +22 −21 PDFWriterTestPlayground/TestsRunner.cpp
  207. +12 −12 PDFWriterTestPlayground/TestsRunner.h
  208. +35 −34 PDFWriterTestPlayground/TiffSpecialsTest.cpp
  209. +6 −6 PDFWriterTestPlayground/TiffSpecialsTest.h
  210. +4 −3 PDFWriterTestPlayground/TimerTest.cpp
  211. +2 −2 PDFWriterTestPlayground/TimerTest.h
  212. +7 −5 PDFWriterTestPlayground/TrueTypeTest.cpp
  213. +2 −2 PDFWriterTestPlayground/TrueTypeTest.h
  214. +24 −22 PDFWriterTestPlayground/Type1Test.cpp
  215. +4 −4 PDFWriterTestPlayground/Type1Test.h
  216. +7 −6 PDFWriterTestPlayground/UppercaseSequanceTest.cpp
  217. +2 −2 PDFWriterTestPlayground/UppercaseSequanceTest.h
@@ -38,6 +38,7 @@
#include <algorithm>
using namespace std;
+using namespace PDFHummus;
ANSIFontWriter::ANSIFontWriter(void)
{
@@ -54,13 +55,13 @@ static const string scBaseFont = "BaseFont";
static const string scToUnicode = "ToUnicode";
static const string scFontDescriptor = "FontDescriptor";
-EPDFStatusCode ANSIFontWriter::WriteFont( FreeTypeFaceWrapper& inFontInfo,
+EStatusCode ANSIFontWriter::WriteFont( FreeTypeFaceWrapper& inFontInfo,
WrittenFontRepresentation* inFontOccurrence,
ObjectsContext* inObjectsContext,
IANSIFontWriterHelper* inANSIFontWriterHelper,
const std::string& inSubsetFontName)
{
- EPDFStatusCode status = ePDFSuccess;
+ EStatusCode status = PDFHummus::eSuccess;
FontDescriptorWriter fontDescriptorWriter;
inObjectsContext->StartNewIndirectObject(inFontOccurrence->mWrittenObjectID);
@@ -111,7 +112,7 @@ EPDFStatusCode ANSIFontWriter::WriteFont( FreeTypeFaceWrapper& inFontInfo,
fontContext->WriteObjectReferenceValue(fontDescriptorObjectID);
status = inObjectsContext->EndDictionary(fontContext);
- if(status != ePDFSuccess)
+ if(status != PDFHummus::eSuccess)
{
TRACE_LOG("ANSIFontWriter::WriteFont, unexpected failure. Failed to end dictionary in font write.");
break;
@@ -359,7 +360,7 @@ void ANSIFontWriter::WriteGlyphEntry(IByteWriter* inWriter,unsigned short inEnco
for(; it != inUnicodeValues.end(); ++it)
{
unicode.GetUnicodeList().push_back(*it);
- EPDFStatusCodeAndUShortList utf16Result = unicode.ToUTF16UShort();
+ EStatusCodeAndUShortList utf16Result = unicode.ToUTF16UShort();
unicode.GetUnicodeList().clear();
if(utf16Result.second.size() == 2)
@@ -20,7 +20,7 @@
*/
#pragma once
-#include "EPDFStatusCode.h"
+#include "EStatusCode.h"
#include "ObjectsBasicTypes.h"
#include "WrittenFontRepresentation.h"
@@ -50,7 +50,7 @@ class ANSIFontWriter
~ANSIFontWriter(void);
- EPDFStatusCode WriteFont( FreeTypeFaceWrapper& inFontInfo,
+ PDFHummus::EStatusCode WriteFont( FreeTypeFaceWrapper& inFontInfo,
WrittenFontRepresentation* inFontOccurrence,
ObjectsContext* inObjectsContext,
IANSIFontWriterHelper* inANSIFontWriterHelper,
@@ -28,6 +28,8 @@
#include "OutputStringBufferStream.h"
#include "SafeBufferMacrosDefs.h"
+using namespace PDFHummus;
+
AbstractContentContext::AbstractContentContext(void)
{
}
@@ -220,7 +222,7 @@ void AbstractContentContext::q()
mGraphicStack.Push();
}
-EPDFStatusCode AbstractContentContext::Q()
+EStatusCode AbstractContentContext::Q()
{
RenewStreamConnection();
AssertProcsetAvailable(KProcsetPDF);
@@ -752,20 +754,20 @@ class ITextCommand
virtual void WriteLiteralStringCommand(const string& inStringToWrite) = 0;
};
-EPDFStatusCode AbstractContentContext::WriteTextCommandWithEncoding(const string& inUnicodeText,ITextCommand* inTextCommand)
+EStatusCode AbstractContentContext::WriteTextCommandWithEncoding(const string& inUnicodeText,ITextCommand* inTextCommand)
{
PDFUsedFont* currentFont = mGraphicStack.GetCurrentState().mFont;
if(!currentFont)
{
TRACE_LOG("AbstractContentContext::WriteTextCommandWithEncoding, Cannot write text, no current font is defined");
- return ePDFFailure;
+ return PDFHummus::eFailure;
}
GlyphUnicodeMappingList glyphsAndUnicode;
- EPDFStatusCode encodingStatus = currentFont->TranslateStringToGlyphs(inUnicodeText,glyphsAndUnicode);
+ EStatusCode encodingStatus = currentFont->TranslateStringToGlyphs(inUnicodeText,glyphsAndUnicode);
// encoding returns false if was unable to encode some of the glyphs. will display as missing characters
- if(encodingStatus != ePDFSuccess)
+ if(encodingStatus != PDFHummus::eSuccess)
TRACE_LOG("AbstractContextContext::WriteTextCommandWithEncoding, was unable to find glyphs for all characters, some will appear as missing");
@@ -783,7 +785,7 @@ class TjCommand : public ITextCommand
AbstractContentContext* mContext;
};
-EPDFStatusCode AbstractContentContext::Tj(const string& inText)
+EStatusCode AbstractContentContext::Tj(const string& inText)
{
TjCommand command(this);
return WriteTextCommandWithEncoding(inText,&command);
@@ -800,7 +802,7 @@ class QuoteCommand : public ITextCommand
AbstractContentContext* mContext;
};
-EPDFStatusCode AbstractContentContext::Quote(const string& inText)
+EStatusCode AbstractContentContext::Quote(const string& inText)
{
QuoteCommand command(this);
return WriteTextCommandWithEncoding(inText,&command);
@@ -821,24 +823,24 @@ class DoubleQuoteCommand : public ITextCommand
double mCharacterSpacing;
};
-EPDFStatusCode AbstractContentContext::DoubleQuote(double inWordSpacing, double inCharacterSpacing, const string& inText)
+EStatusCode AbstractContentContext::DoubleQuote(double inWordSpacing, double inCharacterSpacing, const string& inText)
{
DoubleQuoteCommand command(this,inWordSpacing,inCharacterSpacing);
return WriteTextCommandWithEncoding(inText,&command);
}
-EPDFStatusCode AbstractContentContext::TJ(const StringOrDoubleList& inStringsAndSpacing)
+EStatusCode AbstractContentContext::TJ(const StringOrDoubleList& inStringsAndSpacing)
{
PDFUsedFont* currentFont = mGraphicStack.GetCurrentState().mFont;
if(!currentFont)
{
TRACE_LOG("AbstractContentContext::TJ, Cannot write text, no current font is defined");
- return ePDFFailure;
+ return PDFHummus::eFailure;
}
StringOrDoubleList::const_iterator it = inStringsAndSpacing.begin();
GlyphUnicodeMappingListOrDoubleList parameters;
- EPDFStatusCode encodingStatus;
+ EStatusCode encodingStatus;
for(; it != inStringsAndSpacing.end();++it)
{
@@ -852,7 +854,7 @@ EPDFStatusCode AbstractContentContext::TJ(const StringOrDoubleList& inStringsAnd
encodingStatus = currentFont->TranslateStringToGlyphs(it->SomeValue,glyphsAndUnicode);
// encoding returns false if was unable to encode some of the glyphs. will display as missing characters
- if(encodingStatus != ePDFSuccess)
+ if(encodingStatus != PDFHummus::eSuccess)
TRACE_LOG("AbstractContextContext::TJ, was unable to find glyphs for all characters, some will appear as missing");
parameters.push_back(GlyphUnicodeMappingListOrDouble(glyphsAndUnicode));
}
@@ -861,29 +863,29 @@ EPDFStatusCode AbstractContentContext::TJ(const StringOrDoubleList& inStringsAnd
return TJ(parameters);
}
-EPDFStatusCode AbstractContentContext::Tj(const GlyphUnicodeMappingList& inText)
+EStatusCode AbstractContentContext::Tj(const GlyphUnicodeMappingList& inText)
{
TjCommand command(this);
return WriteTextCommandWithDirectGlyphSelection(inText,&command);
}
-EPDFStatusCode AbstractContentContext::WriteTextCommandWithDirectGlyphSelection(const GlyphUnicodeMappingList& inText,ITextCommand* inTextCommand)
+EStatusCode AbstractContentContext::WriteTextCommandWithDirectGlyphSelection(const GlyphUnicodeMappingList& inText,ITextCommand* inTextCommand)
{
PDFUsedFont* currentFont = mGraphicStack.GetCurrentState().mFont;
if(!currentFont)
{
TRACE_LOG("AbstractContentContext::WriteTextCommandWithDirectGlyphSelection, Cannot write text, no current font is defined");
- return ePDFFailure;
+ return PDFHummus::eFailure;
}
ObjectIDType fontObjectID;
UShortList encodedCharachtersList;
bool writeAsCID;
- if(currentFont->EncodeStringForShowing(inText,fontObjectID,encodedCharachtersList,writeAsCID) != ePDFSuccess)
+ if(currentFont->EncodeStringForShowing(inText,fontObjectID,encodedCharachtersList,writeAsCID) != PDFHummus::eSuccess)
{
TRACE_LOG("AbstractcontextContext::WriteTextCommandWithDirectGlyphSelection, Unexepcted failure, Cannot encode characters");
- return ePDFFailure;
+ return PDFHummus::eFailure;
}
@@ -916,28 +918,28 @@ EPDFStatusCode AbstractContentContext::WriteTextCommandWithDirectGlyphSelection(
}
inTextCommand->WriteLiteralStringCommand(stringStream.ToString());
}
- return ePDFSuccess;
+ return PDFHummus::eSuccess;
}
-EPDFStatusCode AbstractContentContext::Quote(const GlyphUnicodeMappingList& inText)
+EStatusCode AbstractContentContext::Quote(const GlyphUnicodeMappingList& inText)
{
QuoteCommand command(this);
return WriteTextCommandWithDirectGlyphSelection(inText,&command);
}
-EPDFStatusCode AbstractContentContext::DoubleQuote(double inWordSpacing, double inCharacterSpacing, const GlyphUnicodeMappingList& inText)
+EStatusCode AbstractContentContext::DoubleQuote(double inWordSpacing, double inCharacterSpacing, const GlyphUnicodeMappingList& inText)
{
DoubleQuoteCommand command(this,inWordSpacing,inCharacterSpacing);
return WriteTextCommandWithDirectGlyphSelection(inText,&command);
}
-EPDFStatusCode AbstractContentContext::TJ(const GlyphUnicodeMappingListOrDoubleList& inStringsAndSpacing)
+EStatusCode AbstractContentContext::TJ(const GlyphUnicodeMappingListOrDoubleList& inStringsAndSpacing)
{
PDFUsedFont* currentFont = mGraphicStack.GetCurrentState().mFont;
if(!currentFont)
{
TRACE_LOG("AbstractContentContext::TJ, Cannot write text, no current font is defined");
- return ePDFSuccess;
+ return PDFHummus::eSuccess;
}
// TJ is a bit different. i want to encode all strings in the array to the same font, so that at most a single
@@ -958,10 +960,10 @@ EPDFStatusCode AbstractContentContext::TJ(const GlyphUnicodeMappingListOrDoubleL
UShortListList encodedCharachtersListsList;
bool writeAsCID;
- if(currentFont->EncodeStringsForShowing(stringsList,fontObjectID,encodedCharachtersListsList,writeAsCID)!= ePDFSuccess)
+ if(currentFont->EncodeStringsForShowing(stringsList,fontObjectID,encodedCharachtersListsList,writeAsCID)!= PDFHummus::eSuccess)
{
TRACE_LOG("AbstractContentContext::TJ, Unexepcted failure, cannot include characters for writing final representation");
- return ePDFFailure;
+ return PDFHummus::eFailure;
}
// status only returns if strings can be coded or not. so continue with writing regardless
@@ -1025,5 +1027,5 @@ EPDFStatusCode AbstractContentContext::TJ(const GlyphUnicodeMappingListOrDoubleL
}
TJLow(stringOrDoubleList);
}
- return ePDFSuccess;
+ return PDFHummus::eSuccess;
}
@@ -32,7 +32,7 @@
*/
-#include "EPDFStatusCode.h"
+#include "EStatusCode.h"
#include "PrimitiveObjectsWriter.h"
#include "GraphicStateStack.h"
#include "GlyphUnicodeMapping.h"
@@ -100,7 +100,7 @@ class AbstractContentContext
// graphic state
void q();
- EPDFStatusCode Q(); // Status code returned, in case there's inbalance in "q-Q"s
+ PDFHummus::EStatusCode Q(); // Status code returned, in case there's inbalance in "q-Q"s
void cm(double inA, double inB, double inC, double inD, double inE, double inF);
void w(double inLineWidth);
void J(int inLineCapStyle);
@@ -166,12 +166,12 @@ class AbstractContentContext
// will return error if no font was set, or that one of the glyphs
// didn't succeed in encoding.
// input parameter is UTF-8 encoded
- EPDFStatusCode Tj(const string& inText);
+ PDFHummus::EStatusCode Tj(const string& inText);
// The rest of the text operators, handled by the library handing of font. text is in UTF8
- EPDFStatusCode Quote(const string& inText);
- EPDFStatusCode DoubleQuote(double inWordSpacing, double inCharacterSpacing, const string& inText);
- EPDFStatusCode TJ(const StringOrDoubleList& inStringsAndSpacing);
+ PDFHummus::EStatusCode Quote(const string& inText);
+ PDFHummus::EStatusCode DoubleQuote(double inWordSpacing, double inCharacterSpacing, const string& inText);
+ PDFHummus::EStatusCode TJ(const StringOrDoubleList& inStringsAndSpacing);
//
// Text showing operators using the library handling of fonts with direct glyph selection
@@ -181,10 +181,10 @@ class AbstractContentContext
// each command accepts a list of glyphs. each glyph is mapped to its matching unicode values.
// a glyph may have more than one unicode value in case it reperesents a series of Characters.
- EPDFStatusCode Tj(const GlyphUnicodeMappingList& inText);
- EPDFStatusCode Quote(const GlyphUnicodeMappingList& inText);
- EPDFStatusCode DoubleQuote(double inWordSpacing, double inCharacterSpacing, const GlyphUnicodeMappingList& inText);
- EPDFStatusCode TJ(const GlyphUnicodeMappingListOrDoubleList& inStringsAndSpacing);
+ PDFHummus::EStatusCode Tj(const GlyphUnicodeMappingList& inText);
+ PDFHummus::EStatusCode Quote(const GlyphUnicodeMappingList& inText);
+ PDFHummus::EStatusCode DoubleQuote(double inWordSpacing, double inCharacterSpacing, const GlyphUnicodeMappingList& inText);
+ PDFHummus::EStatusCode TJ(const GlyphUnicodeMappingListOrDoubleList& inStringsAndSpacing);
//
// Text showing operators overriding library behavior
@@ -231,6 +231,6 @@ class AbstractContentContext
void AssertProcsetAvailable(const string& inProcsetName);
- EPDFStatusCode WriteTextCommandWithEncoding(const string& inUnicodeText,ITextCommand* inTextCommand);
- EPDFStatusCode WriteTextCommandWithDirectGlyphSelection(const GlyphUnicodeMappingList& inText,ITextCommand* inTextCommand);
+ PDFHummus::EStatusCode WriteTextCommandWithEncoding(const string& inUnicodeText,ITextCommand* inTextCommand);
+ PDFHummus::EStatusCode WriteTextCommandWithDirectGlyphSelection(const GlyphUnicodeMappingList& inText,ITextCommand* inTextCommand);
};
Oops, something went wrong.

0 comments on commit ef610c3

Please sign in to comment.