timesynk/engine/sdl/font.h

24 lines
606 B
C

#ifndef FONT_H
#define FONT_H
#include "interface.h"
/* structs declarations */
struct Font {
unsigned int texture;
int width;
int height;
int s_width; // scaled width
int s_height; // scaled height
float scale_x; // scale ratio, e.g., 1.0 = 100%, 2.0 = 200%
float scale_y;
SDL_Surface *surface;
SDL_Surface *s_surface; // scaled surface
};
struct Font *newFont();
void freeFont(struct Font *font);
void loadFontFromMemory(struct Font *font, unsigned char *memory, unsigned int length, int width, int height);
void setFontScale(struct Font *font, float scale_x, float scale_y);
#endif