taisei/src/resource/font.h

35 lines
694 B
C
Raw Normal View History

/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (C) 2011, Lukas Weber <laochailan@web.de>
*/
#ifndef FONT_H
#define FONT_H
2017-02-04 03:56:40 +01:00
#include <SDL_ttf.h>
#include "texture.h"
typedef enum {
2011-06-24 12:35:03 +02:00
AL_Center,
AL_Left,
AL_Right
} Alignment;
Texture *load_text(const char *text, TTF_Font *font);
void draw_text(Alignment align, float x, float y, const char *text, TTF_Font *font);
void init_fonts(void);
int stringwidth(char *s, TTF_Font *font);
2012-08-05 03:36:55 +02:00
int stringheight(char *s, TTF_Font *font);
int charwidth(char c, TTF_Font *font);
struct Fonts {
TTF_Font *standard;
TTF_Font *mainmenu;
};
extern struct Fonts _fonts;
#endif