// Copyright (C) 2018-2021 Jakub Melka // // This file is part of Pdf4Qt. // // Pdf4Qt is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // with the written consent of the copyright owner, any later version. // // Pdf4Qt is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with Pdf4Qt. If not, see . #ifndef PDFNAMETOUNICODE_H #define PDFNAMETOUNICODE_H #include "pdfglobal.h" #include #include namespace pdf { class Pdf4QtLIBSHARED_EXPORT PDFNameToUnicode { public: explicit PDFNameToUnicode() = delete; /// Returns unicode character for name. If name is not found, then null character is returned. static QChar getUnicodeForName(const QByteArray& name); /// Returns unicode character for name (for ZapfDingbats). If name is not found, then null character is returned. static QChar getUnicodeForNameZapfDingbats(const QByteArray& name); /// Tries to resolve unicode name static QChar getUnicodeUsingResolvedName(const QByteArray& name); private: struct Comparator { inline bool operator()(const QByteArray& left, const std::pair& right) { return left < right.second; } inline bool operator()(const std::pair& left, const QByteArray& right) { return left.second < right; } inline bool operator()(const std::pair& left, const std::pair& right) { return QLatin1String(left.second) < QLatin1String(right.second); } }; }; } // namespace pdf #endif // PDFNAMETOUNICODE_H