GRASS Programmer's Manual
6.4.2(2012)
|
00001 #include <stdlib.h> 00002 #include <string.h> 00003 #include <grass/gis.h> 00004 #include "driverlib.h" 00005 00006 static char *filename; 00007 static int font_index; 00008 static char *charset; 00009 00010 int font_init_freetype(const char *name, int index) 00011 { 00012 if (filename) 00013 G_free(filename); 00014 filename = G_store(name); 00015 00016 font_index = index; 00017 00018 return 0; 00019 } 00020 00021 int font_init_charset(const char *str) 00022 { 00023 if (charset) 00024 G_free(charset); 00025 charset = G_store(str); 00026 return 0; 00027 } 00028 00029 const char *font_get_freetype_name(void) 00030 { 00031 return filename; 00032 } 00033 00034 const char *font_get_charset(void) 00035 { 00036 if (!charset) 00037 charset = G_store("ISO-8859-1"); 00038 return charset; 00039 } 00040 00041 int font_get_index(void) 00042 { 00043 return font_index; 00044 }