missing NULL terminator in set_config_x
[geda-gaf.git] / contrib / gmk_sym / char_width.c
blob3e113f58e51f5489ffb544e527509ccba27d442f
2 #include "config.h"
3 #ifdef HAVE_STRING_H
4 #include <string.h>
5 #endif
7 #define CHAR_POINTS 2
9 const int char_width[]={
10 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
11 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
12 11,14,14,22,28,28,24,10,12,12,16,20,14,20,12,18,
13 26,16,26,20,26,20,24,20,22,26,12,12,20,20,20,20,
14 36,29,29,28,26,29,21,30,29,9,21,27,22,32,28,32,
15 25,32,26,25,23,27,27,37,27,25,27,12,14,12,20,25,
16 10,24,22,22,20,20,12,24,20,8,10,19,9,32,20,20,
17 20,24,14,18,12,19,20,28,19,20,21,12,10,12,22,0,
18 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
19 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
20 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
21 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
22 0,0,0,0,29,29,0,0,0,0,0,0,0,0,0,0,
23 0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,
24 0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,
25 0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0
28 /***************************************************************/
29 /* GetStringDisplayLength: */
30 /* inputs: string to be sized */
31 /* string's font size to use */
32 /* returns: length of string in gEDA points */
33 /***************************************************************/
34 int GetStringDisplayLength(char *str,int font_size)
35 { int width=0;
36 int i, len;
37 len = strlen(str);
38 for (i=0;i<len;i++)
39 width += char_width[(int)str[i]];
40 width = (font_size*width)/CHAR_POINTS;
41 return width;