mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-04-02 18:25:30 +02:00
Port from git
This commit is contained in:
42
Source/Graphics/Font.h
Normal file
42
Source/Graphics/Font.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/* This file is subject to the terms and conditions defined in
|
||||
* file 'LICENSE.txt', which is part of this source code package.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
class Font
|
||||
{
|
||||
public:
|
||||
struct GlyphInfo
|
||||
{
|
||||
int MinX;
|
||||
int MaxX;
|
||||
int MinY;
|
||||
int MaxY;
|
||||
int Advance;
|
||||
SDL_Rect Rect;
|
||||
};
|
||||
|
||||
Font();
|
||||
virtual ~Font();
|
||||
bool Initialize(std::string fontPath, SDL_Color color);
|
||||
void DeInitialize();
|
||||
SDL_Texture *GetTexture();
|
||||
bool GetRect(unsigned int charCode, GlyphInfo &glyph);
|
||||
|
||||
|
||||
private:
|
||||
struct GlyphInfoBuild
|
||||
{
|
||||
Font::GlyphInfo Glyph;
|
||||
SDL_Surface *Surface;
|
||||
};
|
||||
|
||||
std::map<unsigned int, GlyphInfoBuild *> Atlas;
|
||||
SDL_Texture *Texture;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user