freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Couple of PCF metrics fixes


From: Owen Taylor
Subject: [Devel] Couple of PCF metrics fixes
Date: Thu, 29 Aug 2002 18:55:45 -0400 (EDT)
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/21.1

The following fixes two bugs in metrics computation for
the PCF backend

The first is an obvious one ... horiBearingX is the distance
to the left side, not the right side.

The second is slightly more subtle ... as I understand it,
horiBearingX/width are supposed to give the bounds of the 
"ink", so the width here should be 
rightSideBearing - leftSideBearing, not equal to horiAdvance.

Regards,
                                        Owen

--- freetype-2.1.2/src/pcf/pcfdriver.c.leftright        Wed Aug 28 23:36:54 2002
+++ freetype-2.1.2/src/pcf/pcfdriver.c  Wed Aug 28 23:39:26 2002
@@ -509,9 +509,9 @@
     slot->bitmap_top  = metric->ascent;
 
     slot->metrics.horiAdvance  = metric->characterWidth << 6 ;
-    slot->metrics.horiBearingX = metric->rightSideBearing << 6 ;
+    slot->metrics.horiBearingX = metric->leftSideBearing << 6 ;
     slot->metrics.horiBearingY = metric->ascent << 6 ;
-    slot->metrics.width        = metric->characterWidth << 6 ;
+    slot->metrics.width        = (metric->rightSideBearing - 
metric->leftSideBearing) << 6 ;
     slot->metrics.height       = bitmap->rows << 6;
 
     slot->linearHoriAdvance = (FT_Fixed)bitmap->width << 16;



reply via email to

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