summaryrefslogtreecommitdiff
path: root/src/Xw/Xw_isdefine_font.cxx
blob: ca4924092419acab12c7d05d84a6b79f9dfe6584 (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

#include <Xw_Extension.h>

	/* ifdef then trace on */
#ifdef TRACE
#define TRACE_ISDEFINE_FONT
#endif

/*
   XW_STATUS Xw_isdefine_font (afontmap,index):
   XW_EXT_FONTMAP *afontmap
   int index			font index

	Returns XW_ERROR if BadFont Index or font is not defined
	Returns XW_SUCCESS if Successful      

*/

#ifdef XW_PROTOTYPE
XW_STATUS Xw_isdefine_font (void* afontmap,int index)
#else
XW_STATUS Xw_isdefine_font (afontmap,index)
void* afontmap;
int index;
#endif /*XW_PROTOTYPE*/

{
XW_EXT_FONTMAP *pfontmap = (XW_EXT_FONTMAP*)afontmap;
XW_STATUS status = XW_ERROR ;

	if ( index ) {
	    if ( pfontmap && (index < pfontmap->maxfont) &&
				 	pfontmap->fonts[index] ) {
	        status = XW_SUCCESS ;
	    }
	} else status = XW_SUCCESS ;

#ifdef  TRACE_ISDEFINE_FONT
if( Xw_get_trace() > 2 ) {
    printf (" %d = Xw_isdefine_font(%lx,%d)\n",status,(long ) pfontmap,index) ;
}
#endif

	return (status);
}

#ifdef XW_PROTOTYPE
XW_STATUS Xw_isdefine_fontindex (XW_EXT_FONTMAP* afontmap,int index)
#else
XW_STATUS Xw_isdefine_fontindex (afontmap,index)
XW_EXT_FONTMAP* afontmap;
int index;
#endif /*XW_PROTOTYPE*/
/*
	Verify Range index only
*/
{
XW_EXT_FONTMAP *pfontmap = (XW_EXT_FONTMAP*)afontmap;
XW_STATUS status = XW_ERROR ;

	if ( pfontmap && (index > 0) && (index < pfontmap->maxfont) ) {
	    status = XW_SUCCESS ;
	}

#ifdef  TRACE_ISDEFINE_FONT
if( Xw_get_trace() > 2 ) {
    printf (" %d = Xw_isdefine_fontindex(%lx,%d)\n",status,(long ) pfontmap,index) ;
}
#endif

	return (status);
}