From bd894a523e0f4941b81ace92feda337b564e8902 Mon Sep 17 00:00:00 2001 From: "G.K.MacGregor" Date: Thu, 15 Jun 2023 18:55:47 +0100 Subject: [PATCH] Show language names with mod'd G0/G2 character set triplet --- x26model.cpp | 26 ++++++++++++++++++++++++-- x26triplets.cpp | 15 +++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/x26model.cpp b/x26model.cpp index 09c5914..f3c2586 100644 --- a/x26model.cpp +++ b/x26model.cpp @@ -266,7 +266,30 @@ QVariant X26Model::data(const QModelIndex &index, int role) const return result; } break; - //TODO case 0x28: // G0 and G2 designation + case 0x28: // Modified G0 and G2 character set + switch (triplet.data()) { + case 0x20: + return QString("0x20 Cyrillic 1 Serbian/Croatian"); + case 0x24: + return QString("0x24 Cyrillic 2 Russian/Bulgarian"); + case 0x25: + return QString("0x25 Cyrillic 3 Ukranian"); + case 0x36: + return QString("0x36 Latin"); + case 0x37: + return QString("0x37 Greek"); + case 0x40: + case 0x44: + return QString("0x%1 G0 Latin, G2 Arabic").arg(triplet.data(), 2, 16); + case 0x47: + case 0x57: + return QString("0x%1 Arabic").arg(triplet.data(), 2, 16); + case 0x55: + return QString("0x55 G0 Hebrew, G2 Arabic"); + } + if (triplet.data() < 0x27) + return QString("0x%1 Latin").arg(triplet.data(), 2, 16, QChar('0')); + break; case 0x2c: // Display attributes if (triplet.data() & 0x02) result.append("Boxing "); @@ -314,7 +337,6 @@ QVariant X26Model::data(const QModelIndex &index, int role) const result.chop(1); result.append(QString(", %1 row(s)").arg(triplet.data() >> 4)); return result; - case 0x28: // Modified G0 and G2 character set case 0x26: // PDC return QString("0x%1").arg(triplet.data(), 2, 16, QChar('0')); default: // Reserved diff --git a/x26triplets.cpp b/x26triplets.cpp index 959398f..8713253 100644 --- a/x26triplets.cpp +++ b/x26triplets.cpp @@ -174,6 +174,21 @@ void X26TripletList::updateInternalData() if (triplet->m_data >= 0x18) triplet->m_reservedData = true; break; + case 0x28: // Modified G0 and G2 character set + if (triplet->m_data > 0x26) + switch (triplet->m_data) { + case 0x36: + case 0x37: + case 0x40: + case 0x44: + case 0x47: + case 0x55: + case 0x57: + break; + default: + triplet->m_reservedData = true; + } + break; case 0x2d: // DRCS character if ((triplet->m_data & 0x3f) >= 48) // Should really be an error?