diff options
Diffstat (limited to 'tests/PDFGlyphsToUnicodeTest.cpp')
-rw-r--r-- | tests/PDFGlyphsToUnicodeTest.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/PDFGlyphsToUnicodeTest.cpp b/tests/PDFGlyphsToUnicodeTest.cpp index f0425d94fc..b8157caeea 100644 --- a/tests/PDFGlyphsToUnicodeTest.cpp +++ b/tests/PDFGlyphsToUnicodeTest.cpp @@ -7,7 +7,7 @@ #include "SkData.h" #include "SkPDFFont.h" -#include "SkPDFTypes.h" +#include "SkPDFMakeToUnicodeCmap.h" #include "SkStream.h" #include "Test.h" @@ -23,13 +23,6 @@ static bool stream_equals(const SkDynamicMemoryWStream& stream, size_t offset, return memcmp(data->bytes() + offset, buffer, len) == 0; } -void append_cmap_sections(const SkTDArray<SkUnichar>& glyphToUnicode, - const SkPDFGlyphSet* subset, - SkDynamicMemoryWStream* cmap, - bool multiByteGlyphs, - uint16_t firstGlypthID, - uint16_t lastGlypthID); - DEF_TEST(ToUnicode, reporter) { SkTDArray<SkUnichar> glyphToUnicode; SkTDArray<uint16_t> glyphsInSubset; @@ -73,7 +66,7 @@ DEF_TEST(ToUnicode, reporter) { SkDynamicMemoryWStream buffer; subset.set(glyphsInSubset.begin(), glyphsInSubset.count()); - append_cmap_sections(glyphToUnicode, &subset, &buffer, true, 0, 0xFFFF); + SkPDFAppendCmapSections(glyphToUnicode, &subset, &buffer, true, 0, 0xFFFF); char expectedResult[] = "4 beginbfchar\n\ @@ -95,7 +88,7 @@ endbfrange\n"; // Remove characters and ranges. buffer.reset(); - append_cmap_sections(glyphToUnicode, &subset, &buffer, true, 8, 0x00FF); + SkPDFAppendCmapSections(glyphToUnicode, &subset, &buffer, true, 8, 0x00FF); char expectedResultChop1[] = "2 beginbfchar\n\ @@ -113,7 +106,7 @@ endbfrange\n"; // Remove characters from range to downdrade it to one char. buffer.reset(); - append_cmap_sections(glyphToUnicode, &subset, &buffer, true, 0x00D, 0x00FE); + SkPDFAppendCmapSections(glyphToUnicode, &subset, &buffer, true, 0x00D, 0x00FE); char expectedResultChop2[] = "2 beginbfchar\n\ @@ -126,7 +119,7 @@ endbfchar\n"; buffer.reset(); - append_cmap_sections(glyphToUnicode, nullptr, &buffer, false, 0xFC, 0x110); + SkPDFAppendCmapSections(glyphToUnicode, nullptr, &buffer, false, 0xFC, 0x110); char expectedResultSingleBytes[] = "2 beginbfchar\n\ @@ -162,7 +155,7 @@ endbfrange\n"; SkDynamicMemoryWStream buffer2; subset2.set(glyphsInSubset.begin(), glyphsInSubset.count()); - append_cmap_sections(glyphToUnicode, &subset2, &buffer2, true, 0, 0xffff); + SkPDFAppendCmapSections(glyphToUnicode, &subset2, &buffer2, true, 0, 0xffff); char expectedResult2[] = "4 beginbfchar\n\ |