mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Better font handling
This commit is contained in:
@ -4540,4 +4540,27 @@ QChar PDFNameToUnicode::getUnicodeForNameZapfDingbats(const QByteArray& name)
|
||||
}
|
||||
}
|
||||
|
||||
QChar PDFNameToUnicode::getUnicodeUsingResolvedName(const QByteArray& name)
|
||||
{
|
||||
QChar character = getUnicodeForName(name);
|
||||
|
||||
// Try ZapfDingbats, if this fails
|
||||
if (character.isNull())
|
||||
{
|
||||
character = getUnicodeForNameZapfDingbats(name);
|
||||
}
|
||||
|
||||
if (character.isNull() && name.startsWith("uni"))
|
||||
{
|
||||
QByteArray hexValue = QByteArray::fromHex(name.mid(3, -1));
|
||||
if (hexValue.size() == 2)
|
||||
{
|
||||
unsigned short value = (static_cast<unsigned char>(hexValue[0]) << 8) + static_cast<unsigned char>(hexValue[1]);
|
||||
character = QChar(value);
|
||||
}
|
||||
}
|
||||
|
||||
return character;
|
||||
}
|
||||
|
||||
} // namespace pdf
|
||||
|
Reference in New Issue
Block a user