2 var float(string text, float handleColors) stringwidth;
4 float stringwidth_oldfont(string text, float handleColors)
6 float i, len, ch, width;
11 for(i = 0; i < len; ++i)
13 if(substring(text, i, 1) == "^")
15 ch = str2chr(text, i+1);
16 if(ch >= '0' && ch <= '9')
27 void CSQC_CheckEngine()
30 registercvar("csqc_flags", "0");
31 csqc_flags = cvar("csqc_flags");
36 if(checkextension("DP_SV_WRITEPICTURE"))
38 stringwidth = stringwidth_engine;
39 sbar_font = FONT_USER+1;
40 csqc_flags |= CSQC_FLAG_READPICTURE;
42 stringwidth = stringwidth_oldfont;
43 sbar_font = FONT_DEFAULT;
47 vector Sbar_GetFontsize()
49 if(csqc_flags & CSQC_FLAG_READPICTURE)
50 return stov(cvar_string("sbar_fontsize"));
54 float PreviewExists(string name)
58 file = strcat(name, ".tga");
59 f = fopen(file, FILE_READ);
65 file = strcat(name, ".png");
66 f = fopen(file, FILE_READ);
72 file = strcat(name, ".jpg");
73 f = fopen(file, FILE_READ);
79 file = strcat(name, ".pcx");
80 f = fopen(file, FILE_READ);