diff -rcN src.orig/Makefile src/Makefile *** src.orig/Makefile Tue Jan 23 02:56:11 2001 --- src/Makefile Thu Feb 1 12:34:07 2001 *************** *** 6,12 **** # HP/UX cc needs CFLAGS = -Aa (HP/UX 9) or -Ae (HP/UX 10) # BS2000/OSD needs CFLAGS = -XLLML -XLLMK # NeXTSTEP needs CFLAGS = -O2 -pipe -no-precomp ! DEFS = # any combination of -DNOPIPES -DNODNS -DNODIRENT -DNOOPEN ... # ... -DNOALARM -DNOGRAPHICS -DEBCDIC -DNOGMTIME ... # ... -DUSE_PLAIN_SETJMP -DHAVE_GD -DHAVE_PCRE ... # ... -DNEED_STRCMP -DNEED_MEMMOVE -DNEED_STRTOUL ... --- 6,12 ---- # HP/UX cc needs CFLAGS = -Aa (HP/UX 9) or -Ae (HP/UX 10) # BS2000/OSD needs CFLAGS = -XLLML -XLLMK # NeXTSTEP needs CFLAGS = -O2 -pipe -no-precomp ! DEFS = -DHAVE_GD -DUSE_TTF # any combination of -DNOPIPES -DNODNS -DNODIRENT -DNOOPEN ... # ... -DNOALARM -DNOGRAPHICS -DEBCDIC -DNOGMTIME ... # ... -DUSE_PLAIN_SETJMP -DHAVE_GD -DHAVE_PCRE ... # ... -DNEED_STRCMP -DNEED_MEMMOVE -DNEED_STRTOUL ... *************** *** 22,28 **** # OS = UNIX # Operating system: UNIX, DOS, WIN32, MAC, OS2, OSX, VMS # RISCOS, BEOS, NEXTSTEP, MPEIX, BS2000, AS400 ! LIBS = -lm # extra libraries needed; all platforms need -lm last; # if you defined HAVE_GD above you also need -lgd -lpng -lz; # if you defined HAVE_PCRE above you also need -lpcre; also # Solaris 2 (SunOS 5+) needs LIBS = -lnsl -lm --- 22,28 ---- # OS = UNIX # Operating system: UNIX, DOS, WIN32, MAC, OS2, OSX, VMS # RISCOS, BEOS, NEXTSTEP, MPEIX, BS2000, AS400 ! LIBS = -lm -lpng -lz -lgd -lttf # extra libraries needed; all platforms need -lm last; # if you defined HAVE_GD above you also need -lgd -lpng -lz; # if you defined HAVE_PCRE above you also need -lpcre; also # Solaris 2 (SunOS 5+) needs LIBS = -lnsl -lm diff -rcN src.orig/README.ttf src/README.ttf *** src.orig/README.ttf Thu Jan 1 09:00:00 1970 --- src/README.ttf Thu Feb 1 20:13:42 2001 *************** *** 0 **** --- 1,38 ---- + analog-4.90beta1 TrueType patch + =============================== + + ¡¢¥¦¡¢¥Û¡¦¥à¡¦¥Æ¡¦¥Á¡¢¥Þ analog-4.90beta1 ¡¢¥Û¥½¥­¥ª¡£¥Ì¥¹¡¢¥Ì¡¢¡Ö¡¢ö³¡¬¡¦¡¼¡¦ò§¥æ¡¢¥Ò¡¢¥§¡¢¡¢¡¢¥Ë¥Ë€€¥ï¥¯ø¦€€¥¹¥·¥£¥¤¥È¥Ì¥¹ + ¡¢¥Í¡¢¥±¡¢¥ë¡¢¥Ã¡£¡ÖTrueType¡¢¥Ò¡¢ð¦ö§¥æ¡¦¥¥¡¦€€¥Í¥Î¥¹¥·¥£¥ª¡£¥Ì¥¹¡¢€€¥Î¥¤¥Æ¡¢¥±¡¢ö¦ä¦¥Û¡¢¥Ì¡¢¥±¡£¡× + + + ¡Ö¡×¥Ê¥ã¥Ø¥à¥Ï€€¡£ + + analog-4.90beta1¡¢€€¥¯¥¦¥©¡¢¥­¡¢¥½¡¦¥Ì¡¦¡×¡¦ø§¥Ã¡¦¥Í¡¦ô¦¥Ò¡¢¥§¡¢¡¢¡¢¥Ë¡£¡Ö + patch < analog-4.90beta1-ttf0.1.patch + + + ¡Ö¡×¥Ï¥ó¥»¥ì + + ¡¢¥¦¡¢¥Û¡¦¥¹¡¦¥æ¡¦¥Í¡¦¥ò¡¦¥¡¡¦¡Ö¡¢¥Ò¡¢¥Þ¥Ï¥ó¥»¥ì¡¢¥Þ¡¢¡Ö¡¢ô¦¡«¡¢¥µ¡¢€€¡×¡¢¥¨¥·¥©¥Ï¥ã¡¢¥Û¥¿¥æ¥Ì¡¢¡¢¥Ò¡¢¥§¡¢¡¢¡¢¥Ë¥µ¥Í¥Ø¥à¡¢¥­¡¢¥Ë¡¢¥Ã¡¢¥¿¡¢¥ª¡¢¡¢¡£¡× + ¡¦¥à¡¦¥Æ¡¦¥Á¡¢¥Û¡¦¥ß¡¦¡¼¡¢€€¡¢¥¿¥ª¡¢¥ª¡¢ø¦¥½¥»ø»î¦¥Ò¡¢¥Þ¥µè¥ߥ¦¥¿¡¢¡«¡¢¥Ì¥Þ¡Ö¥Øú¦¡¢¡¢¥½¡¢¥¿¡¢¥¢¡¢ø¦¥ß¥±¥ã¡¢¡¢¡¢¥Ì¡¢¥±¡£¡× + + + ¡Ö¡×¥Æ€€ü¾¥ä + + Kazuhito Ishigaki (¥¿¥ß¥¦¥¿ ¥Þ¥Ä¥½¥Ø) + ishigaki@factory.gr.jp + http://www.factory.gr.jp/ + + + ¡Ö¡×¥È¥Î¥¤¥Æ¡¢¥ª¡¢ø¦ö·¡£¥Ì¥¹ + + analog.cfg¡¢¥Ò¡¢¥§¡¢¡¢¡¢¥Ë¡£¡Ö¡£¥èTTFFILE¡£¥é¡¢¥§¡¢ð¦¥â¡£¥èTTFSIZE¡£¥é¡¢¥ã¥µ¥Í¥Ø¥à¡¢¥Ì¡¢¥å¡¢ö¦ð¦¥ò¡¢¥Ò¡¢¥Ï¡¢ô¦¡«¡¢¥±¡£¡× + + TTFFILE ¡¢€€ô·¥Á¡¢¥­¡¢¥Ï¡¢¡¢¥»ø»î¦¥Þ¡¦¥§¡¦ô§¥¯¡¦¥Ï¡¦ö¦¥Í¥Ë¥¢¥Ø¥Ø¡¢¥Û¥Ë¡¼¥³ü¦¥Í¡¢¥Ï¡¢ô¦¡«¡¢¥±¡¢¥ã¡£¡ÖTTFFILE¡¢¥Ò + TrueType¡¦¥æ¡¦¥¥¡¦€€¥Í¡¢¥Û¡¦¥æ¡¦ö§¥à¡¦¥±¡¢€€¥å¥¹¥á¡¢¥­¡¢¥½¥»ø»î¦¥Þ¡£¡Ö¡¦¡¼¡¦ò§¥æ¥Æì¦¥Û¥Ï¥¯¥µ€€¥ã¡¢¥¹¡¢¥Û¡¦¥æ¡¦¥¥¡¦€€¥Í¡¢¥Ì¥Î¥Á + ¥¤ð¦¥ª¡¢ø¦¡«¡¢¥±¡£¡× + + TTFSIZE ¡¢¥ÞTrueType¡¦¥æ¡¦¥¥¡¦€€¥Í¥Î¥Á¥¤ð½€€¥Û¥Ï¥¯¥µ€€¥ª¡¦¡¢¡¦¥³(point¥Æ¥¢¡¼¥Õ)¡¢€€¥ê¥Èô¦¥­¡¢¡«¡¢¥±¡£¡×¥µ¥ê¥Èô¦¥­ + ¡¢¥Ï¡¢¡¢¥»ø»î¦¥Þ12point¡¢¥Í¡¢¥Ï¡¢ô¦¡«¡¢¥±¡£¡× + + ¡¼¥Ï¥»å diff -rcN src.orig/anlghea3.h src/anlghea3.h *** src.orig/anlghea3.h Tue Jan 23 02:56:11 2001 --- src/anlghea3.h Thu Feb 1 18:28:57 2001 *************** *** 784,789 **** --- 784,796 ---- char *file; } Lang; + #ifdef USE_TTF + typedef struct { + double pt; + char *file; + } Ttf; + #endif + typedef struct { char *outfile, *cacheoutfile; char *domainsfile, *descfile, *headerfile, *footerfile; *************** *** 821,826 **** --- 828,836 ---- char *baseurl; logical searchconv; unsigned char convfloor; + #ifdef USE_TTF + Ttf ttf; + #endif } Outchoices; typedef struct { diff -rcN src.orig/anlghea4.h src/anlghea4.h *** src.orig/anlghea4.h Tue Jan 23 02:56:11 2001 --- src/anlghea4.h Thu Feb 1 18:28:35 2001 *************** *** 138,143 **** --- 138,146 ---- extern void configchart(void *opt, char *cmd, char *arg1, char *arg2, int rc); extern void configallchart(void *opt, char *cmd, char *arg1, char *arg2, int rc); + #ifdef USE_TTF + extern void configfontsize(void *opt, char *cmd, char *arg1, char *arg2, int rc); + #endif #endif extern void configdebug(void *opt, char *cmd, char *arg1, char *arg2, int rc); extern void configonoff(void *opt, char *cmd, char *arg1, char *arg2, int rc); diff -rcN src.orig/globals.c src/globals.c *** src.orig/globals.c Tue Jan 23 02:56:12 2001 --- src/globals.c Thu Feb 1 19:22:46 2001 *************** *** 81,86 **** --- 81,89 ---- #ifndef NOGRAPHICS gdImagePtr im; gdFontPtr font; + #ifdef USE_TTF + choice ttfenable; + #endif int white, black, grey, lightgrey, colours[NO_COLOURS], col, texty; double totangle; #endif *************** *** 619,624 **** --- 622,631 ---- (void *)&(opts.outopts.aliashead[G(REP_FAILUSER)])}, #ifndef NOPIPES {"UNCOMPRESS", &configstrpairlist, (void *)&uncompresshead}, + #ifdef USE_TTF + {"TTFFILE", &configstr, (void *)&(opts.outopts.ttf.file)}, + {"TTFSIZE", &configfontsize, (void *)&(opts.outopts.ttf.pt)}, + #endif #endif {"REQARGS", &configtree, (void *)&(opts.outopts.tree[G(REP_REQ)])}, {"REDIRARGS", &configtree, (void *)&(opts.outopts.tree[G(REP_REDIR)])}, *************** *** 1546,1551 **** --- 1553,1563 ---- op->outopts.chartby[G(REP_SIZE)] = SIZECHART; op->outopts.chartby[G(REP_CODE)] = STATUSCHART; op->outopts.chartby[G(REP_PROCTIME)] = PROCTIMECHART; + #ifdef USE_TTF + op->outopts.ttf.pt = 12.0; + op->outopts.ttf.file = NULL; + ttfenable = FALSE; + #endif #else for (i = 0; i < GENREP_NUMBER; i++) op->outopts.chartby[i] = CHART_NONE;/* to avoid recording spurious stuff */ diff -rcN src.orig/init.c src/init.c *** src.orig/init.c Tue Jan 23 02:56:12 2001 --- src/init.c Thu Feb 1 18:29:13 2001 *************** *** 875,880 **** --- 875,883 ---- extern char *pos; extern logical vblesonly; extern logical unprintable[256]; + #ifdef USE_TTF + extern choice ttfenable; + #endif logical wantcol[ITEM_NUMBER][DATA_NUMBER]; choice *cols; *************** *** 984,989 **** --- 987,996 ---- font = gdFontSmall; else font = gdFontFixed; + #ifdef USE_TTF + if (op->outopts.ttf.file != NULL) + ttfenable = TRUE; + #endif #endif for (i = 0; i < 7; i++) DEFAULTSTR(op->outopts.dayname[i], diff -rcN src.orig/init2.c src/init2.c *** src.orig/init2.c Tue Jan 23 02:56:12 2001 --- src/init2.c Thu Feb 1 19:10:18 2001 *************** *** 266,271 **** --- 266,299 ---- else for (i = 0; i < GENREP_NUMBER; i++) q[i] = p; } + + #ifdef USE_TTF + void configfontsize(void *opt, char *cmd, char *arg1, char *arg2, int rc) { + double *x = (double *)opt; + char **c; + double y; + + if (rc == 0 || IS_EMPTY_STRING(arg1)) { + shortwarn(cmd, arg1, rc); + return; + } + if (!ISDIGIT(arg1[0])) { + badwarn(cmd, TRUE, arg1, arg2, rc); + return; + } + c = (char **)xmalloc(sizeof(char *)); + y = strtod(arg1, c); + if (rc > 1 || **c != '\0') + longwarn(cmd, arg1, arg2, rc); + if (y > 48.0 || y < 5.0) + warn('C', TRUE, "Ignoring font size of more than 48 or less than 5 point in configuration " + "command\n%s %s", cmd, arg1); + else { + *x = y; + } + free((void *)c); + } + #endif #endif /* NOGRAPHICS */ void configdebug(void *opt, char *cmd, char *arg1, char *arg2, int rc) { diff -rcN src.orig/output2.c src/output2.c *** src.orig/output2.c Tue Jan 23 02:56:13 2001 --- src/output2.c Thu Feb 1 19:00:15 2001 *************** *** 12,17 **** --- 12,23 ---- extern choice *rep2type, *rep2reqs, *rep2reqs7, *rep2date, *rep2firstd; extern char repcodes[], *repname[]; + #ifdef USE_TTF + extern choice ttfenable; + /* dirty hack */ + static Ttf *ttfinfo; + #endif + /* Print "goto"s. Assume outstyle == HTML and want-gotos already tested. */ void gotos(FILE *outf, Outchoices *od, choice rep) { extern char *anchorname[]; *************** *** 1960,1967 **** --- 1966,1983 ---- else strcat(workspace, lngstr[method2sort[chartby]]); strcat(workspace, "."); + #ifdef USE_TTF + if (ttfenable) { + int brect[8]; + gdImageStringTTF(im, brect, black, ttfinfo->file, ttfinfo->pt, 0.0, CAPTIONLEFT, CAPTIONTOP, (unsigned char *)workspace); + } else { + gdImageString(im, font, CAPTIONLEFT, CAPTIONTOP, (unsigned char *)workspace, + black); + } + #else gdImageString(im, font, CAPTIONLEFT, CAPTIONTOP, (unsigned char *)workspace, black); + #endif } void piechart_wedge(double angle, char *s) { *************** *** 2005,2018 **** --- 2021,2052 ---- if (gdImageGetPixel(im, (int)x, (int)y) == white) { gdImageFill(im, (int)x, (int)y, colour); if ((len = strlen(s)) <= MAXCHARS - 1) + #ifdef USE_TTF + if (ttfenable) { + int brect[8]; + gdImageStringTTF(im, brect, colour, ttfinfo->file, ttfinfo->pt, 0.0, TEXTLEFT, texty, (unsigned char *)s); + } else { + gdImageString(im, font, TEXTLEFT, texty, (unsigned char *)s, colour); + } + #else gdImageString(im, font, TEXTLEFT, texty, (unsigned char *)s, colour); + #endif else { strncpy(t, s, (MAXCHARS - 3) / 2); strcpy(t + (MAXCHARS - 3) / 2, "..."); strncpy(t + (MAXCHARS + 3) / 2, s + len - (MAXCHARS - 4) / 2, (MAXCHARS - 4) / 2); t[MAXCHARS - 1] = '\0'; + #ifdef USE_TTF + if (ttfenable) { + int brect[8]; + gdImageStringTTF(im, brect, colour, ttfinfo->file, ttfinfo->pt, 0.0, TEXTLEFT, texty, (unsigned char *)t); + } else { + gdImageString(im, font, TEXTLEFT, texty, (unsigned char *)t, colour); + } + #else gdImageString(im, font, TEXTLEFT, texty, (unsigned char *)t, colour); + #endif } texty += TEXTGAP; } *************** *** 2051,2056 **** --- 2085,2093 ---- char *otherstr, *filename, n[13]; /* 13 = anchorname ( <= 8 ) + ".png\0" */ int i; + #ifdef USE_TTF + ttfinfo = &od->ttf; + #endif /* Sort out what the chartby really means */ if (chartby == CHART_NONE) return; /* We didn't want a pie chart after all */