1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#pragma once
#include "globalincs/pstypes.h"
#include "graphics/software/FSFont.h"
namespace font
{
struct font;
class NVGFont : public FSFont
{
private:
int m_handle;
float m_letterSpacing;
float m_size;
float m_tabWidth;
font* m_specialCharacters;
float m_lineHeight = 0.0f;
public:
NVGFont();
~NVGFont() override;
int getHandle() const { return m_handle; }
float getSize() const { return m_size; }
float getLetterSpacing() const { return m_letterSpacing; }
float getTabWidth() const { return m_tabWidth; }
font* getSpecialCharacterFont() const { return m_specialCharacters; }
void setHandle(int handle);
void setSize(float size);
void setLetterSpacing(float spacing);
void setTabWidth(float tabWidth);
void setSpecialCharacterFont(font* fontData);
FontType getType() const override { return NVG_FONT; };
float getTextHeight() const override;
void getStringSize(const char *text, size_t textLen, int resize_mode,
float *width, float *height) const override;
void computeFontMetrics() override;
static size_t getTokenLength(const char *string, size_t maxLength);
};
}
|