| -rw-
/* Aligning on 16-bit boundary */
if(header.value("nbits").toInt() % 2 == 1)
data >> byte;
/* Loading the offset table if necessary */
if(header.value("noffset").toInt() > 0)
{
int bytesToRead;
if(header.value("nbits").toInt() > maxFontSizeFor16BitOffsets)
bytesToRead = 4 * header.value("noffset").toInt();
else
bytesToRead = 2 * header.value("noffset").toInt();
offsetData = new quint16[bytesToRead];
data.readRawData(reinterpret_cast<char*>(offsetData), bytesToRead);
}
/* Loading the width table if necessary */
if(header.value("nwidth").toInt() > 0)
{
widthData = new quint8[header.value("nwidth").toInt()];
data.readRawData(reinterpret_cast<char*>(widthData),
header.value("nwidth").toInt());
}
fin.close();
/* Caching the font data */
cache = new RBFontCache::CacheInfo;
cache->imageData = imageData;
cache->offsetData = offsetData;
cache->widthData = widthData;
cache->header = header;
RBFontCache::insert(file, cache);
if(!badFile)
valid = true;
}
RBFont::~RBFont()
{
}
RBText* RBFont::renderText(QString text, QColor color, int viewWidth,
QGraphicsItem *parent)
{
/* Checking for |