[tex-live] \pdffontattr in pdftex-1.40.0-rc4

Thanh Han The hanthethanh at gmail.com
Thu Jan 4 18:30:31 CET 2007


Hi,

sorry for the late response. The patch by Hartmut should
solve the problem.

to Hartmut:
> > > pdfTeX warning (\pdffontattr): font \^^@ has conflicting attributes
> is this a nullfont? how does one get it?

this font has been loaded from a virtual font, hence it
doesn't get any control sequence.

I made another patch, which is more or less the same as what
Hartmut did, plus some changes to make the warning more
meaningful. Don't be afraid by the length of the patch, it
just turns the module @<Print the font identifier for |font(p)|@>
to a function named print_font_identifier() so it can be called
with different parameters.

Thanh


--- /home/thanh/s2/pdftex.web	2006-12-20 16:16:42.000000000 +0100
+++ pdftex.web	2007-01-04 18:26:42.000000000 +0100
@@ -4062,7 +4062,33 @@
 @ Boxes, rules, inserts, whatsits, marks, and things in general that are
 sort of ``complicated'' are indicated only by printing `\.{[]}'.

- at p procedure short_display(@!p:integer); {prints highlights of list |p|}
+ at p
+procedure print_font_identifier(f: internal_font_number);
+begin
+    if pdf_font_blink[f] = null_font then
+        print_esc(font_id_text(f))
+    else
+        print_esc(font_id_text(pdf_font_blink[f]));
+    if pdf_tracing_fonts > 0 then begin
+        print(" (");
+        print(font_name[f]);
+        if font_size[f] <> font_dsize[f] then begin
+            print("@@");
+            print_scaled(font_size[f]);
+            print("pt");
+        end;
+        print(")");
+    end else
+        if pdf_font_expand_ratio[f] <> 0 then begin
+            print(" (");
+            if pdf_font_expand_ratio[f] > 0 then
+                print("+");
+            print_int(pdf_font_expand_ratio[f]);
+            print(")");
+        end;
+end;
+
+procedure short_display(@!p:integer); {prints highlights of list |p|}
 var n:integer; {for replacement counts}
 begin while p>mem_min do
   begin if is_char_node(p) then
@@ -4071,7 +4097,7 @@
         begin if (font(p)<font_base)or(font(p)>font_max) then
           print_char("*")
 @.*\relax@>
-        else @<Print the font identifier for |font(p)|@>;
+        else print_font_identifier(font(p));
         print_char(" "); font_in_short_display:=font(p);
         end;
       print_ASCII(qo(character(p)));
@@ -4110,7 +4136,7 @@
 begin if p>mem_end then print_esc("CLOBBERED.")
 else  begin if (font(p)<font_base)or(font(p)>font_max) then print_char("*")
 @.*\relax@>
-  else @<Print the font identifier for |font(p)|@>;
+  else print_font_identifier(font(p));
   print_char(" "); print_ASCII(qo(character(p)));
   end;
 end;
@@ -6771,31 +6797,6 @@
 Meanwhile, this is a convenient place to catch up on something we were unable
 to do before the hash table was defined:

-@<Print the font identifier for |font(p)|@>=
-begin
-    if pdf_font_blink[font(p)] = null_font then
-        print_esc(font_id_text(font(p)))
-    else
-        print_esc(font_id_text(pdf_font_blink[font(p)]));
-    if pdf_tracing_fonts > 0 then begin
-        print(" (");
-        print(font_name[font(p)]);
-        if font_size[font(p)] <> font_dsize[font(p)] then begin
-            print("@@");
-            print_scaled(font_size[font(p)]);
-            print("pt");
-        end;
-        print(")");
-    end else
-        if pdf_font_expand_ratio[font(p)] <> 0 then begin
-            print(" (");
-            if pdf_font_expand_ratio[font(p)] > 0 then
-                print("+");
-            print_int(pdf_font_expand_ratio[font(p)]);
-            print(")");
-        end;
-end
-
 @* \[19] Saving and restoring equivalents.
 The nested structure provided by `$\.{\char'173}\ldots\.{\char'175}$' groups
 in \TeX\ means that |eqtb| entries valid in outer groups should be saved
@@ -14943,7 +14944,7 @@
         begin if (font(p)<font_base)or(font(p)>font_max) then
           print_char("*")
 @.*\relax@>
-        else @<Print the font identifier for |font(p)|@>;
+        else print_font_identifier(font(p));
         print_char(" "); font_in_short_display:=font(p);
         end;
       print_ASCII(qo(character(p)));
@@ -19340,11 +19341,15 @@
             if pdf_char_marked(k, j) then
                 pdf_mark_char(i, j);
         if (length(pdf_font_attr[i]) = 0) and
(length(pdf_font_attr[k]) <> 0) then
-            pdf_font_attr[i] := pdf_font_attr[k];
-        if not ((pdf_font_attr[i] = pdf_font_attr[k]) or
-           str_eq_str(pdf_font_attr[i], pdf_font_attr[k])) then begin
-           pdf_warning("\pdffontattr", "font ", false, false);
-           print_esc(font_id_text(k));
+            pdf_font_attr[i] := pdf_font_attr[k]
+        else if (length(pdf_font_attr[k]) = 0) and
(length(pdf_font_attr[i]) <> 0) then
+            pdf_font_attr[k] := pdf_font_attr[i]
+        else if (length(pdf_font_attr[i]) <> 0) and
(length(pdf_font_attr[k]) <> 0) and
+           not str_eq_str(pdf_font_attr[i], pdf_font_attr[k]) then begin
+           pdf_warning("\pdffontattr", "fonts ", false, false);
+           print_font_identifier(i);
+           print(" and ");
+           print_font_identifier(k);
            print(" has conflicting attributes"); print_ln; print_ln;
         end;
     end;

On Thu, Dec 28, 2006 at 06:38:51AM +0100, Hartmut Henkel wrote:
> On Thu, 28 Dec 2006, Hartmut Henkel wrote:
>
> > On Wed, 27 Dec 2006, Reinhard Kotucha wrote:
> >
> > > I'm trying to run the vntex testfiles with the current pdftex
> > > release recently uploaded to the TeXLive repository by Martin.
> > >
> > > Can anybody tell me what the warnings mean?
> > >
> > > pdfTeX warning (\pdffontattr): font \^^@ has conflicting attributes
>
> is this a nullfont? how does one get it?
>
> > in the intended cases it means, that it was tried to add two different
> > font attributes to the same font dictionary. But here is a case where
> > this happens even without:
> >
> > \pdfcompresslevel=0
> > \nopagenumbers
> > \font\aa cmr10 at 10pt
> > \pdffontattr\aa {foo}
> > \aa abc
> > \font\bb cmr10 at 11pt
> > %\pdffontattr\bb {bar}
> > \bb abc
> > \bye
> >
> > Both TeX fonts refer to the same font dictionary. So there is only one
> > font, and this gets the attribute "foo".
> >
> > > I get a lot of these messages.  The (pdf) output seems to be ok.
> >
> > The above source creates the right PDF. Maybe we need to get rid of
> > the warning here.
>
> Here is the try of a patch, which also shows what happens with the above
> file. Reinhard, does it remove the warnings in your case?
>
> --- pdftex.web.orig	2006-12-21 17:19:20.000000000 +0100
> +++ pdftex.web	2006-12-28 06:07:11.771455920 +0100
> @@ -19341,6 +19341,8 @@
>                  pdf_mark_char(i, j);
>          if (length(pdf_font_attr[i]) = 0) and (length(pdf_font_attr[k]) <> 0) then
>              pdf_font_attr[i] := pdf_font_attr[k];
> +        if (length(pdf_font_attr[k]) = 0) and (length(pdf_font_attr[i]) <> 0) then
> +            pdf_font_attr[k] := pdf_font_attr[i];
>          if not ((pdf_font_attr[i] = pdf_font_attr[k]) or
>             str_eq_str(pdf_font_attr[i], pdf_font_attr[k])) then begin
>             pdf_warning("\pdffontattr", "font ", false, false);
>
> An alternative (more complicated) might be that one keeps font
> dictionaries separate when the user wants different attributes. No idea
> what the typical use of these attributes is.
>
> Regards, Hartmut


More information about the tex-live mailing list