home *** CD-ROM | disk | FTP | other *** search
- head 1.2;
- access;
- symbols;
- locks; strict;
- comment @ * @;
-
-
- 1.2
- date 94.04.27.11.37.54; author peteric; state Exp;
- branches;
- next 1.1;
-
- 1.1
- date 94.03.26.11.34.52; author peteric; state Exp;
- branches;
- next ;
-
-
- desc
- @test program for AFM.c
- @
-
-
- 1.2
- log
- @minor changes to font handling to match afm.c.
- @
- text
- @/* test routine for afm code */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include "ftree.h"
-
- char *psfontpath;
- int main(int argc, char *argv[])
- {
- int i;
- char *font = NULL;
- char *s1, *s2, *s3, *s4, *s5, *s6;
- fontinfo_t fi;
-
- psfontpath = "";
-
- s1 = "abcdefghijklmnopqrstuvwxyz";
- s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- s3 = "VAflffij";
- s4 = "1234567890 !@@#$%^&*()_+-=";
- s5 = "The Rain in Spain falls Mainly on the Plain";
- s6 = "The Quick Brown Fox Jumped over the Lazy Dog";
-
- for(i = 1; i < argc; i++)
- {
- font = argv[i];
- fi.font = font;
- fi.size = 16;
- fi.linespc = 17;
-
- printf("loading %s...\n", fi.font);
- if (loadfont(&fi))
- {
- printf("%s:\n", font);
- printf("%s width %f\n", s1, stringwidth(&fi, 0.0, s1));
- printf("%s width %f\n", s2, stringwidth(&fi, 0.0, s2));
- printf("%s width %f\n", s3, stringwidth(&fi, 0.0, s3));
- printf("%s width %f\n", s4, stringwidth(&fi, 0.0, s4));
- printf("%s width %f\n", s5, stringwidth(&fi, 0.0, s5));
- printf("%s width %f\n", s6, stringwidth(&fi, 0.0, s6));
- }
- }
- }
-
- /*(
- *************************************************************
- *
- * Function: _dprintf
- *
- *
- * Inputs:
- * str - printf() style format string
- * ... - args as required by str
- *
- * Outputs:
- * none.
- *
- * Error Handling:
- * none.
- *
- * Description:
- *
- * if debug mode is active, prints out the
- * string as fprintf(stderr, str) would. If not active,
- * does nothing.
- *
- *************************************************************
- )*/
- #include <stdarg.h>
- #ifdef amiga
- #define DEBUGFILE "ram:debug.afmtst"
- #else
- #define DEBUGFILE "debug.afmtst"
- #endif
-
- static FILE *debugfile = 0;
-
- void _dprintf(char *str, ...)
- {
- va_list ap;
-
- va_start(ap, str);
- if (debugfile == 0)
- debugfile = fopen(DEBUGFILE, "w");
-
- vfprintf(debugfile, str, ap);
- fflush(debugfile);
- va_end(ap);
- }
-
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d7 1
- d14 2
- d32 1
- a32 1
- if (loadfont(font))
- d43 46
- @
-