Restore the "GPL licensing not permitted" in GLUT license headers.
[haiku.git] / src / libs / glut / glut_swidth.c
blobe979d7109aade6242f88be8a9f156e6a38f53262
1 /*
2 * Copyright 1994-1997 Mark Kilgard, All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * GPL licensing not permitted.
7 * Authors:
8 * Mark Kilgard
9 */
12 #include "glutint.h"
13 #include "glutstroke.h"
16 /* CENTRY */
17 int APIENTRY
18 glutStrokeWidth(GLUTstrokeFont font, int c)
20 StrokeFontPtr fontinfo;
21 const StrokeCharRec *ch;
23 #if defined(_WIN32)
24 fontinfo = (StrokeFontPtr) __glutFont(font);
25 #else
26 fontinfo = (StrokeFontPtr) font;
27 #endif
29 if (c < 0 || c >= fontinfo->num_chars)
30 return 0;
31 ch = &(fontinfo->ch[c]);
32 if (ch)
33 return ch->right;
34 else
35 return 0;
38 int APIENTRY
39 glutStrokeLength(GLUTstrokeFont font, const unsigned char *string)
41 int c, length;
42 StrokeFontPtr fontinfo;
43 const StrokeCharRec *ch;
45 #if defined(_WIN32)
46 fontinfo = (StrokeFontPtr) __glutFont(font);
47 #else
48 fontinfo = (StrokeFontPtr) font;
49 #endif
51 length = 0;
52 for (; *string != '\0'; string++) {
53 c = *string;
54 if (c >= 0 && c < fontinfo->num_chars) {
55 ch = &(fontinfo->ch[c]);
56 if (ch)
57 length += ch->right;
60 return length;
63 /* ENDCENTRY */