generate correct left side bearings
authorMatthias Kramm <kramm@quiss.org>
Fri, 19 Mar 2010 22:16:35 +0000 (15:16 -0700)
committerMatthias Kramm <kramm@quiss.org>
Fri, 19 Mar 2010 22:16:35 +0000 (15:16 -0700)
lib/gfxfont.c
lib/ttf.c
lib/ttf.h

index 760db9a..acc8e34 100644 (file)
@@ -665,6 +665,7 @@ ttf_t* gfxfont_to_ttf(gfxfont_t*font)
            }
        }
 
+       dest->bearing = dest->xmin;
        dest->advance = src->advance*scale;
 
        int u = font->glyphs[t].unicode;
index 69cd3f1..fbbf200 100644 (file)
--- a/lib/ttf.c
+++ b/lib/ttf.c
@@ -849,10 +849,10 @@ static int mtx_write(ttf_t*ttf, ttf_table_t*w)
     int t;
     for(t=0;t<num_advances;t++) {
        writeU16(w, ttf->glyphs[t].advance);
-       writeU16(w, ttf->glyphs[t].bearing);
+       writeS16(w, ttf->glyphs[t].bearing);
     }
     for(;t<ttf->num_glyphs;t++) {
-       writeU16(w, ttf->glyphs[t].bearing);
+       writeS16(w, ttf->glyphs[t].bearing);
     }
     return num_advances;
 }
index 8d5ea61..e5462e9 100644 (file)
--- a/lib/ttf.h
+++ b/lib/ttf.h
@@ -122,7 +122,7 @@ typedef struct _ttfpoint {
 } ttfpoint_t;
 typedef struct _ttfglyph {
     U16 advance;
-    U16 bearing;
+    S16 bearing;
     S16 xmin,ymin,xmax,ymax;
     int code_size;
     U8*code;