freetype-devel
[Top][All Lists]
Advanced

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

Advance width for fixed pitch T1 fonts


From: otaylor_at_redhat . com
Subject: Advance width for fixed pitch T1 fonts
Date: 09 Oct 2000 16:23:35 -0400
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

While trying out Keith Packard's anti-aliased xterm, I ran into a
problem: the max_advance_width field for a fixed pitch type1 font is
bogus (far too small)

The problem turns out to be the following it uses 
standard_width[0] from the private dictionary to get the default
value for this field, but looking up what this is, it is the
horizontal stem width, not the width of the font.

The best predefined value I could find is font_bbox.xMax but 
I'm not sure that this is "good enough". So, it might be best
simply to compute the advance width for fixed pitch fonts the
same way that it does for proportional fonts, and only use
the xMax from the bbox as a fallback value.

The following patch (really just a suggestion, needs cleanup 
when applying) does this.

Regards,
                                        Owen

Index: src/type1z/z1objs.c
===================================================================
RCS file: /cvsroot/freetype2/src/type1z/z1objs.c,v
retrieving revision 1.11
diff -u -r1.11 z1objs.c
--- z1objs.c    2000/09/29 06:41:56     1.11
+++ z1objs.c    2000/10/08 10:03:06
@@ -270,10 +270,10 @@
 
       /* now compute the maximum advance width */
 
-      root->max_advance_width = face->type1.private_dict.standard_width[0];
+      root->max_advance_width = face->type1.font_bbox.xMax;
 
       /* compute max advance width for proportional fonts */
-      if ( !face->type1.font_info.is_fixed_pitch )
+      if ( 1 )
       {
         FT_Int  max_advance;
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]