all repos — mgba @ 797441c379af788b89968964fcddf219afa42487

mGBA Game Boy Advance Emulator

src/util/gui/font.h (view raw)

 1/* Copyright (c) 2013-2015 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef GUI_FONT_H
 7#define GUI_FONT_H
 8
 9#include "util/common.h"
10
11struct GUIFont;
12struct GUIFont* GUIFontCreate(void);
13void GUIFontDestroy(struct GUIFont*);
14
15enum GUITextAlignment {
16	GUI_TEXT_LEFT = 0,
17	GUI_TEXT_CENTER,
18	GUI_TEXT_RIGHT
19};
20
21struct GUIFontGlyphMetric {
22	int width;
23	int height;
24	struct {
25		int top;
26		int right;
27		int bottom;
28		int left;
29	} padding;
30};
31
32unsigned GUIFontHeight(const struct GUIFont*);
33
34void GUIFontPrintf(const struct GUIFont*, int x, int y, enum GUITextAlignment, uint32_t color, const char* text, ...);
35
36#endif