3 Copyright 1993 by Davor Matic
5 Permission to use, copy, modify, distribute, and sell this software
6 and its documentation for any purpose is hereby granted without fee,
7 provided that the above copyright notice appear in all copies and that
8 both that copyright notice and this permission notice appear in
9 supporting documentation. Davor Matic makes no representations about
10 the suitability of this software for any purpose. It is provided "as
11 is" without express or implied warranty.
15 #ifdef HAVE_XNEST_CONFIG_H
16 #include <xnest-config.h>
20 #include <X11/Xatom.h>
21 #include <X11/Xproto.h>
23 #include "regionstr.h"
24 #include <X11/fonts/font.h>
25 #include <X11/fonts/fontstruct.h>
26 #include "scrnintstr.h"
33 int xnestFontPrivateIndex
;
36 xnestRealizeFont(ScreenPtr pScreen
, FontPtr pFont
)
39 Atom name_atom
, value_atom
;
45 FontSetPrivate(pFont
, xnestFontPrivateIndex
, NULL
);
47 name_atom
= MakeAtom("FONT", 4, True
);
50 nprops
= pFont
->info
.nprops
;
51 props
= pFont
->info
.props
;
53 for (i
= 0; i
< nprops
; i
++)
54 if (props
[i
].name
== name_atom
) {
55 value_atom
= props
[i
].value
;
62 name
= NameForAtom(value_atom
);
67 priv
= (pointer
) malloc(sizeof(xnestPrivFont
));
68 FontSetPrivate(pFont
, xnestFontPrivateIndex
, priv
);
70 xnestFontPriv(pFont
)->font_struct
= XLoadQueryFont(xnestDisplay
, name
);
72 if (!xnestFontStruct(pFont
))
79 xnestUnrealizeFont(ScreenPtr pScreen
, FontPtr pFont
)
81 if (xnestFontPriv(pFont
)) {
82 if (xnestFontStruct(pFont
))
83 XFreeFont(xnestDisplay
, xnestFontStruct(pFont
));
84 free(xnestFontPriv(pFont
));
85 FontSetPrivate(pFont
, xnestFontPrivateIndex
, NULL
);