Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!umich!samsung!brutus.cs.uiuc.edu!psuvax1!psuvm!JANUS!SVERMEULEN From: svermeulen@JANUS.MTROYAL.AB.CA Newsgroups: bit.listserv.i-amiga Subject: RE: An old trick... Message-ID: <900206185434.2a204bc1@Janus.MtRoyal.AB.CA> Date: 7 Feb 90 01:54:34 GMT Sender: Info-Amiga List Reply-To: Info-Amiga List Lines: 72 Approved: NETNEWS@PSUVM Gateway In-Reply-To: Your message <900205184512.019@ucnet.ucalgary.ca> dated 5-Feb-1990 Here is REN in all it's glory... /***************************************************** ren.c This program allows one to rename the directory which contains the font data files. syntax: ren thisfont.font path ******************************************************/ #include char newname[256], oldname[256]; main(argc, argv) int argc; char *argv[]; { FILE *font; long j, pos; short i, n; if (argc != 3) { printf("ren filename.font newpath\n"); printf("Copyright 1988 By Stephen Vermeulen (403) 282-7990\n"); printf("PO Box 3295, Station B, Calgary, Alta., CANADA, T2M 4L8\n"); printf("May be distributed without charge, so long as the Copyright\n"); printf("notice and credits remain unmodified.\n"); } else { font = fopen(argv[1], "r+"); if (font) { /******************************************** now determine how many sizes this font has *********************************************/ fread(&n, 2, 1, font); /** throw away **/ fread(&n, 2, 1, font); /** number of sizes **/ printf("Font %s has %d sizes\n", argv[1], n); for (i = 0; i < n; ++i) { /** for each size we rename it... **/ fseek(font, 4L + 260L * i, 0); fread(oldname, 256, 1, font); printf("name was: %s ", oldname); for (j = 255; j > 0; --j) if (oldname[j] == '/') break; strcpy(newname, argv[2]); strcat(newname, oldname + j); fseek(font, 4L + 260L * i, 0); printf("now is: %s\n", newname); fwrite(newname, 256, 1, font); } fclose(font); } } } -------------------------------------------------------------- Regards, Stephen Vermeulen PO Box 3295 Author: Express Paint, Spritz and Fusion Paint Station B Newsletter Editor of AMUC (the AMiga Users of Calgary) Calgary, Alberta SVermeulen % Janus.MtRoyal.AB.CA @ UncaNet.BITnet ...or... CANADA SVermeulen % Janus.MRC.AdhocNet.CA @ UncaEdu.BITnet T2M 4L8