mirror of
https://github.com/overte-org/overte.git
synced 2025-07-30 06:06:27 +02:00
22 lines
569 B
C++
22 lines
569 B
C++
#include "Glyph.h"
|
|
#include <StreamHelpers.h>
|
|
|
|
// We adjust bounds because offset is the bottom left corner of the font but the top left corner of a QRect
|
|
QRectF Glyph::bounds() const {
|
|
return glmToRect(offset, size).translated(0.0f, -size.y);
|
|
}
|
|
|
|
QRectF Glyph::textureBounds() const {
|
|
return glmToRect(texOffset, texSize);
|
|
}
|
|
|
|
void Glyph::read(QIODevice& in) {
|
|
uint16_t charcode;
|
|
readStream(in, charcode);
|
|
c = charcode;
|
|
readStream(in, texOffset);
|
|
readStream(in, size);
|
|
readStream(in, offset);
|
|
readStream(in, d);
|
|
texSize = size;
|
|
}
|