X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fbb9d,4c99882067408f83 X-Google-Attributes: gidfbb9d,public X-Google-ArrivalTime: 1994-08-12 17:26:14 PST Path: bga.com!news.sprintlink.net!sashimi.wwa.com!gagme.wwa.com!not-for-mail From: flee@cse.psu.edu (Felix Lee) Newsgroups: rec.arts.ascii Subject: Talk: Figlet fonts Date: 12 Aug 1994 16:18:30 -0500 Organization: Penn State Comp Sci & Eng Lines: 48 Sender: boba@gagme.wwa.com Approved: boba@wwa.com Message-ID: <32gov6$7i2@gagme.wwa.com> References: <32f0ku$726@gagme.wwa.com> NNTP-Posting-Host: gagme.wwa.com Dennis Monbourquette: > So what should I do when I make future Figlet fonts? Use the CR/LFs and >say that it is specifically a DOS Figlet font, or convert it to just LFs >and post both... seems like a lot of work just to please unix-types. Is >there any way to get them to work on both without converting them? Yup. Fix figlet to ignore '\r'. here's a quick patch that makes it ignore any trailing whitespace in the flf file. *** 1.1 1994/08/12 13:11:46 --- figlet.c 1994/08/12 13:20:37 *************** *** 481,492 **** if (fgets(inputline,charwidthlimit,fontfile)==NULL) { inputline[0]='\0'; } ! k=strlen(inputline)-1; ! endchar=k<0?'\0':(k==0||inputline[k]!='\n')?inputline[k]:inputline[k-1]; ! for(;k>=0?(inputline[k]=='\n' || inputline[k]==endchar):0;k--) { ! inputline[k]='\0'; } ! charlist[i]=(char*)my_alloc(sizeof(char)*(strlen(inputline)+1)); strcpy(charlist[i],inputline); } fclose(fontfile); --- 481,500 ---- if (fgets(inputline,charwidthlimit,fontfile)==NULL) { inputline[0]='\0'; } ! k = strlen(inputline) - 1; ! /* skip over trailing spaces. */ ! while (0 <= k && isspace(inputline[k])) { ! --k; ! } ! /* skip over trailing delimiters. */ ! if (0 <= k) { ! endchar = inputline[k]; ! while (0 <= k && inputline[k] == endchar) { ! --k; } ! } ! inputline[k + 1] = '\0'; ! charlist[i] = (char*) my_alloc(sizeof(char) * (k + 1)); strcpy(charlist[i],inputline); } fclose(fontfile);