[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: T1 encoding and font subsetting dont mix in dvips (fixed, kinda)



Further to my mailing, here's a fix for dvips...  The problem I
encountered was due to the fact that t1part.c seemed to think that if a
glyph wasn't accessible in a font's default encoding, it couldn't be
accessed no matter how much reencoding was done. This is blatantly
wrong. Enclosed is a hack to the source that makes it do the right
thing...  it could probably be cleaned up a little.

It seems though, that I've now found a different bug. It seems that
even on my first example that supposidly worked, t1part somehow
botches the job of subsetting Utopia. This is true of 5.60 and 5.70
and unrelated to my previous encoding bug and fix.

Thankfully, really I was working in Lucida, so this isn't an immediate
problem for me.

In other news, I also consider the current handling of ``%%DocumentFonts:''
identically to ``%%DocumentNeededFonts:'' to be a bug. Thus, I have
patch for finclude.c too.

Best Regards,

    Melissa.

Enc.

--- t1part.c.orig	Sun Mar  2 20:15:54 1997
+++ t1part.c	Wed Mar 19 18:06:48 1997
@@ -562,7 +562,9 @@
     while (ThisChar != NULL)
     {
         CHAR *tm = ThisChar;
-        fprintf(fout, "dup %d %s put\n",ThisChar->num,ThisChar->name);
+	if (ThisChar->num > 0) {
+	  fprintf(fout, "dup %d %s put\n", ThisChar->num, ThisChar->name);
+	}
         ThisChar = ThisChar->NextChar;
         free(tm);
     }
@@ -675,6 +677,18 @@
                 return  1;
             }
         }
+	if (ThisChar->NextChar == NULL) {
+	      CHAR *NewChar = getmem(sizeof(CHAR));
+
+	      NewChar->name = getmem(length + 1);
+	      strcpy(NewChar->name, name);
+	      NewChar->length = length;
+	      NewChar->num = -1;
+	      NewChar->NextChar = NULL;
+	      NewChar->choose = 1;
+	      ThisChar->NextChar = NewChar;
+	      return 1;
+	}
         ThisChar = ThisChar->NextChar;
     }
     return -1;
--- finclude.c.orig	Wed Mar 19 01:22:20 1997
+++ finclude.c	Wed Mar 19 01:23:43 1997
@@ -18,7 +18,9 @@
 #define getname vms_getname
 #endif
 
+#ifndef NeXT
 double atof();
+#endif
 /*
  *   These are the external routines we call.
  */
@@ -356,17 +358,7 @@
 char *p;
 char *psfile;
 {
-  if (strncmp(p, "%%DocumentFonts: ",17) == 0) {
-    p += 17 ;
-    while (*p && *p <= ' ')
-       p++ ;
-    if(!strncmp(p,"(atend)",7)) {
-      check_atend = 1;
-    } else {
-      scan_fontnames(p,psfile);
-      fc_state = 1;
-    }
-  } else if (strncmp(p, "%%DocumentNeededFonts: ",23)==0) {
+  if (strncmp(p, "%%DocumentNeededFonts: ",23)==0) {
     p += 23 ;
     while (*p && *p <= ' ')
        p++ ;