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 
27 struct gl_font;
28 
29 #define GLF_FLG_LCD (1 << 0)
30 
32 {
38 };
39 
40 struct gl_font *glf_alloc(int height, int flags);
41 void glf_free(struct gl_font *glf);
42 
43 int glf_load_face_file(struct gl_font *glf, const char *filename);
44 int glf_load_face_mem(struct gl_font *glf, const void *data, size_t len);
45 
46 float glf_width_str(const struct gl_font *glf, const char *str);
47 
48 void 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 
53 void 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 
58 void glf_begin(const struct gl_font *glf, float fg_color[3]);
59 void 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])
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)
struct gl_font * glf_alloc(int height, int flags)
@ 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