diff --git a/Pdf4QtLib/sources/pdffont.cpp b/Pdf4QtLib/sources/pdffont.cpp index e8a3fc5..35b9dc8 100644 --- a/Pdf4QtLib/sources/pdffont.cpp +++ b/Pdf4QtLib/sources/pdffont.cpp @@ -2117,9 +2117,31 @@ PDFFontCMap PDFFontCMap::createFromData(const QByteArray& data) std::pair from = fetchCode(token1); std::pair to = fetchCode(token2); - CID cid = fetchUnicode(token3); - entries.emplace_back(from.first, to.first, qMax(from.second, to.second), cid); + if (token3.type == PDFLexicalAnalyzer::TokenType::ArrayStart) + { + unsigned int current = from.first; + + while (true) + { + PDFLexicalAnalyzer::Token arrayToken = parser.fetch(); + + // Do we have end of array? + if (arrayToken.type == PDFLexicalAnalyzer::TokenType::ArrayEnd) + { + break; + } + + CID cid = fetchUnicode(arrayToken); + entries.emplace_back(current, current, qMax(from.second, to.second), cid); + ++current; + } + } + else + { + CID cid = fetchUnicode(token3); + entries.emplace_back(from.first, to.first, qMax(from.second, to.second), cid); + } } } else if (command == "begincidrange")