GNU Radio's TEST Package
gl_font.h
Go to the documentation of this file.
1/*
2 * gl_font.h
3 *
4 * Basic OpenGL font rendering
5 *
6 * Copyright (C) 2013-2021 Sylvain Munaut
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 */
9
10#pragma once
11
12/*! \defgroup gl/font
13 * @{
14 */
15
16/*! \file gl_font.h
17 * \brief Basic OpenGL font rendering
18 */
19
20#ifdef _MSC_VER
21# define ATTR_FORMAT(a,b,c)
22#else
23# define ATTR_FORMAT(a,b,c) __attribute__((format(a,b,c)))
24#endif
25
26
27struct gl_font;
28
29#define GLF_FLG_LCD (1 << 0)
30
39
40struct gl_font *glf_alloc(int height, int flags);
41void glf_free(struct gl_font *glf);
42
43int glf_load_face_file(struct gl_font *glf, const char *filename);
44int glf_load_face_mem(struct gl_font *glf, const void *data, size_t len);
45
46float glf_width_str(const struct gl_font *glf, const char *str);
47
48void glf_draw_str(const struct gl_font *glf,
49 float x, enum glf_align x_align,
50 float y, enum glf_align y_align,
51 const char *str);
52
53void glf_printf(const struct gl_font *glf,
54 float x, enum glf_align x_align,
55 float y, enum glf_align y_align,
56 const char *fmt, ...) ATTR_FORMAT(printf, 6, 7);
57
58void glf_begin(const struct gl_font *glf, float fg_color[3]);
59void glf_end(void);
60
61
62/*! @} */
void glf_end(void)
float glf_width_str(const struct gl_font *glf, const char *str)
int glf_load_face_file(struct gl_font *glf, const char *filename)
#define ATTR_FORMAT(a, b, c)
Definition gl_font.h:23
void glf_printf(const struct gl_font *glf, float x, enum glf_align x_align, float y, enum glf_align y_align, const char *fmt,...) ATTR_FORMAT(printf
int glf_load_face_mem(struct gl_font *glf, const void *data, size_t len)
glf_align
Definition gl_font.h:32
void void glf_begin(const struct gl_font *glf, float fg_color[3])
struct gl_font * glf_alloc(int height, int flags)
void glf_draw_str(const struct gl_font *glf, float x, enum glf_align x_align, float y, enum glf_align y_align, const char *str)
void glf_free(struct gl_font *glf)
@ GLF_RIGHT
Definition gl_font.h:34
@ GLF_CENTER
Definition gl_font.h:37
@ GLF_BOTTOM
Definition gl_font.h:36
@ GLF_TOP
Definition gl_font.h:35
@ GLF_LEFT
Definition gl_font.h:33