GRASS Programmer's Manual  6.4.2(2012)
gsd_fonts.c
Go to the documentation of this file.
00001 
00021 #include <string.h>
00022 #include <assert.h>
00023 
00024 #include <grass/gstypes.h>
00025 #include <grass/ogsf_proto.h>
00026 
00027 #include "rgbpack.h"
00028 
00037 int gsd_get_txtwidth(const char *s, int size)
00038 {
00039     int width, len;
00040 
00041     len = strlen(s);
00042     width = (size * len) / 2;
00043 
00044     return (width);
00045 }
00046 
00054 int gsd_get_txtheight(int size)
00055 {
00056     unsigned long height;
00057 
00058     height = size / 2;
00059 
00060     return (height);
00061 
00062 }
00063 
00073 int get_txtdescender(void)
00074 {
00075     return (2);
00076 }
00077 
00087 int get_txtxoffset(void)
00088 {
00089     return (0);
00090 }
00091 
00099 void do_label_display(GLuint fontbase, float *lab_pos, const char *txt)
00100 {
00101     glRasterPos2f(lab_pos[X], lab_pos[Y]);
00102     glListBase(fontbase);
00103     glCallLists(strlen(txt), GL_UNSIGNED_BYTE, (const GLvoid *)txt);
00104 
00105     return;
00106 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines