2 /* Copyright (c) Mark J. Kilgard, 1995. */
4 /* This program is freely distributable without licensing fees
5 and is provided without guarantee or warrantee expressed or
6 implied. This program is -not- in the public domain. */
10 #include "glutstroke.h"
14 glutStrokeWidth(GLUTstrokeFont font
, int c
)
16 StrokeFontPtr fontinfo
;
17 const StrokeCharRec
*ch
;
20 fontinfo
= (StrokeFontPtr
) __glutFont(font
);
22 fontinfo
= (StrokeFontPtr
) font
;
25 if (c
< 0 || c
>= fontinfo
->num_chars
)
27 ch
= &(fontinfo
->ch
[c
]);
29 return (int)ch
->right
;
35 glutStrokeLength(GLUTstrokeFont font
, const char *string
)
38 StrokeFontPtr fontinfo
;
39 const StrokeCharRec
*ch
;
42 fontinfo
= (StrokeFontPtr
) __glutFont(font
);
44 fontinfo
= (StrokeFontPtr
) font
;
48 for (; *string
!= '\0'; string
++) {
50 if (c
>= 0 && c
< fontinfo
->num_chars
) {
51 ch
= &(fontinfo
->ch
[c
]);
53 length
+= (int)ch
->right
;