31 lines
778 B
C++
31 lines
778 B
C++
// Copyright (c) 2023 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#pragma once
|
|
#include "Font.hpp"
|
|
#include "display/Tileset.hpp"
|
|
|
|
namespace Dawn {
|
|
class BitmapFont : public Font {
|
|
protected:
|
|
|
|
public:
|
|
Texture *texture = nullptr;
|
|
TilesetGrid *tileset = nullptr;
|
|
|
|
void buffer(
|
|
std::string text,
|
|
float_t fontSize,
|
|
float_t maxWidth,
|
|
Mesh *mesh,
|
|
struct FontMeasure *info
|
|
) override;
|
|
bool_t isReady() override;
|
|
Texture * getTexture() override;
|
|
void draw(Mesh *mesh, int32_t startCharacter, int32_t length) override;
|
|
float_t getLineHeight(float_t fontSize) override;
|
|
float_t getDefaultFontSize() override;
|
|
};
|
|
} |