GRASS Programmer's Manual  6.4.2(2012)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gsd_fonts.c
Go to the documentation of this file.
1 
21 #include <string.h>
22 #include <assert.h>
23 
24 #include <grass/gstypes.h>
25 #include <grass/ogsf_proto.h>
26 
27 #include "rgbpack.h"
28 
37 int gsd_get_txtwidth(const char *s, int size)
38 {
39  int width, len;
40 
41  len = strlen(s);
42  width = (size * len) / 2;
43 
44  return (width);
45 }
46 
54 int gsd_get_txtheight(int size)
55 {
56  unsigned long height;
57 
58  height = size / 2;
59 
60  return (height);
61 
62 }
63 
74 {
75  return (2);
76 }
77 
87 int get_txtxoffset(void)
88 {
89  return (0);
90 }
91 
99 void do_label_display(GLuint fontbase, float *lab_pos, const char *txt)
100 {
101  glRasterPos2f(lab_pos[X], lab_pos[Y]);
102  glListBase(fontbase);
103  glCallLists(strlen(txt), GL_UNSIGNED_BYTE, (const GLvoid *)txt);
104 
105  return;
106 }