ALT Linux repositórios
S: | 2.4.7-alt1 |
5.0: | 1.3.10-alt1 |
4.1: | 1.3.10-alt0.M41.4 |
+updates: | 1.3.9-alt1.M41.1 |
4.0: | 1.2.12-alt6.M40.9 |
+updates: | 1.2.12-alt6.M40.8 |
3.0: | 1.1.20-alt14.1 |
Group :: Sistema/Servidores
RPM: cups
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: cups-1.1.20-asp-texttops.patch
Download
Download
diff -Naur cups-1.1.20/filter/texttops.c cups-1.1.20.new/filter/texttops.c
--- cups-1.1.20/filter/texttops.c 2002-12-17 21:59:30 +0300
+++ cups-1.1.20.new/filter/texttops.c 2003-11-28 16:42:49 +0300
@@ -151,7 +151,10 @@
"cupsBold",
"cupsItalic"
};
-
+ static char *hex = "0123456789abcdef";
+ int res, inp1, inp2, len, count;
+ char *hexp, *inp; /* Pointers to hexline/line buffers */
+ char hexline[1024]; /* Hex buffer for *.pfb binary section */
/*
* Get the data directory...
@@ -743,12 +746,56 @@
/**** MRS: Need to use CUPS_FONTPATH env var! ****/
/**** Also look for Fontmap file or name.pfa, name.pfb... ****/
snprintf(filename, sizeof(filename), "%s/fonts/%s", datadir, fonts[i]);
- if ((fp = fopen(filename, "rb")) != NULL)
- {
- while ((j = fread(line, 1, sizeof(line), fp)) > 0)
- fwrite(line, 1, j, stdout);
-
- fclose(fp);
+ if ((fp = fopen(filename, "rb")) != NULL) {
+ inp1 = fgetc(fp);
+ if (inp1 != 0x80) /*pfa font file*/
+ {
+ fputc(inp1,stdout);
+ while (fgets(line, sizeof(line), fp) != NULL)
+ fputs(line,stdout);
+ }
+ else /*pfb font file */
+ while (inp2=fgetc(fp))
+ {
+ if (inp2 < 0x04) {
+ if (inp2 != 0x03) {
+ len = fgetc(fp) & 0xff;
+ len |= (fgetc(fp) & 0xff) << 8;
+ len |= (fgetc(fp) & 0xff) << 16;
+ len |= (fgetc(fp) & 0xff) << 24;
+ while (len >0 )
+ {
+ count = (len>512 ? 512 : len);
+ res = fread(line, 1, count, fp);
+ if (res != count)
+ len = res;
+ if (inp2 == 0x01)
+ fwrite(line,1,res,stdout);
+ else
+ {
+ hexp=hexline;
+ for (inp=line; inp-line<res; inp++)
+ {
+ *hexp++ =hex[(*inp >> 4) & 0xf];
+ *hexp++ =hex[*inp & 0xf];
+ }
+ fwrite(hexline,1,(2*res),stdout);
+ }
+ len -=res;
+ }
+ fputc(0x0a,stdout);
+ }
+ else break;
+ }
+ else {
+ fprintf (stderr, "ERROR: Wrong pfb font file %s\n",filename);
+ fclose (fp);
+ exit(1);
+ }
+ if (!fgetc(fp))
+ break;
+ }
+ fclose(fp);
}
puts("\n%%EndResource");