forked from 42Paris/minilibx-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mlx_set_font.c
30 lines (26 loc) · 1.31 KB
/
mlx_set_font.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* mlx_set_font.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: amalliar <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/09/30 13:30:47 by amalliar #+# #+# */
/* Updated: 2020/09/30 17:08:36 by amalliar ### ########.fr */
/* */
/* ************************************************************************** */
#include "mlx_int.h"
/*
** Allows to specify the font that will be used by mlx_string_put.
**
** Note: only fixed-width bitmap fonts are supported by Xlib, refer to xfontsel
** utility to get valid font names for this function.
*/
void mlx_set_font(t_xvar *xvar, t_win_list *win, char *name)
{
static Font font = 0;
if (font)
XUnloadFont(xvar->display, font);
font = XLoadFont(xvar->display, name);
XSetFont(xvar->display, win->gc, font);
}