2010-06-23 20:18:31 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Robert Bieber
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef RBFONT_H
|
|
|
|
#define RBFONT_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QFile>
|
2010-07-06 19:19:11 +00:00
|
|
|
#include <QGraphicsPixmapItem>
|
2010-07-05 22:15:17 +00:00
|
|
|
#include <QHash>
|
2010-06-23 20:18:31 +00:00
|
|
|
|
2010-07-06 19:19:11 +00:00
|
|
|
#include "rbtext.h"
|
|
|
|
|
2010-06-23 20:18:31 +00:00
|
|
|
class RBFont
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RBFont(QString file);
|
|
|
|
virtual ~RBFont();
|
|
|
|
|
2010-07-07 06:50:30 +00:00
|
|
|
RBText* renderText(QString text, QColor color, int maxWidth,
|
2010-06-25 05:14:13 +00:00
|
|
|
QGraphicsItem* parent = 0);
|
2010-07-06 19:19:11 +00:00
|
|
|
int lineHeight(){ return header.value("height", 0).toInt(); }
|
|
|
|
|
|
|
|
static quint16 maxFontSizeFor16BitOffsets;
|
2010-06-25 05:14:13 +00:00
|
|
|
|
2010-06-23 20:18:31 +00:00
|
|
|
private:
|
2010-07-05 22:15:17 +00:00
|
|
|
QHash<QString, QVariant> header;
|
2010-07-06 19:19:11 +00:00
|
|
|
bool valid;
|
|
|
|
quint8* imageData;
|
|
|
|
quint16* offsetData;
|
|
|
|
quint8* widthData;
|
2010-06-23 20:18:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RBFONT_H
|