[cairo-commit] src/cairo-truetype-subset.c

Kristian Høgsberg krh at kemper.freedesktop.org
Tue Sep 26 14:37:10 PDT 2006


 src/cairo-truetype-subset.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

New commits:
diff-tree f9165638bf485591abae52b759fba82caf048dc5 (from 7c3062240ac036c8091ee9f0acce0aa3ea9df8ea)
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Tue Sep 26 17:33:29 2006 -0400

    Compute right index when looking up left side bearing.
    
    When looking up the short entries in the second part of
    the hmtx table, compute the size of the first part correctly.
    
    Fix from Adrian, see:
    
      https://bugs.freedesktop.org/show_bug.cgi?id=8180#c12

diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
index c5e1799..8b1c5f5 100644
--- a/src/cairo-truetype-subset.c
+++ b/src/cairo-truetype-subset.c
@@ -591,10 +591,9 @@ cairo_truetype_font_write_hmtx_table (ca
             }
             font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
                                                 TT_TAG_hmtx,
-                                                (num_hmetrics - 1) * long_entry_size +
-                                                (font->glyphs[i].parent_index - num_hmetrics)
-                                                                          * short_entry_size,
-                                                (unsigned char *) (p+1), &short_entry_size);
+                                                num_hmetrics * long_entry_size +
+                                                (font->glyphs[i].parent_index - num_hmetrics) * short_entry_size,
+                                                (unsigned char *) (p + 1), &short_entry_size);
         }
         font->base.widths[i] = be16_to_cpu (p[0]);
     }


More information about the cairo-commit mailing list