freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] parthw-cleaned 2f59a4c: [gf, pk] Resolve *glyph jumping* err


From: Parth Wazurkar
Subject: [freetype2] parthw-cleaned 2f59a4c: [gf, pk] Resolve *glyph jumping* error.
Date: Tue, 7 Aug 2018 23:52:33 -0400 (EDT)

branch: parthw-cleaned
commit 2f59a4c8a94d81c78a84c7a2b2b724d7ca0fc8aa
Author: Parth Wazurkar <address@hidden>
Commit: Parth Wazurkar <address@hidden>

    [gf, pk] Resolve *glyph jumping* error.
    
    * src/gf/gfdrivr.c(GF_Load_Glyph): Modify glyph metric values
    to resolve the *glyph jumping* error and make the glyphs to
    properly sit on baseline.
    
    * src/pk/pkdrivr.c(PK_Glyph_Load): Ditto.
---
 src/gf/gfdrivr.c | 6 ++----
 src/pk/pkdrivr.c | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/gf/gfdrivr.c b/src/gf/gfdrivr.c
index 5cebaee..13a5717 100644
--- a/src/gf/gfdrivr.c
+++ b/src/gf/gfdrivr.c
@@ -369,7 +369,6 @@
     FT_Bitmap*   bitmap = &slot->bitmap;
     GF_BitmapRec bm;
     GF_Glyph     go;
-    FT_Int       ascent;
 
     go = gf->gf_glyph;
 
@@ -427,14 +426,13 @@
     /*       we can simply point to it                         */
     ft_glyphslot_set_bitmap( slot, bm.bitmap );
 
-    ascent = (bm.bbx_height + bm.off_y);
     slot->format      = FT_GLYPH_FORMAT_BITMAP;
     slot->bitmap_left = bm.off_x ;
-    slot->bitmap_top  = ascent ;
+    slot->bitmap_top  = bm.off_y ;
 
     slot->metrics.horiAdvance  = (FT_Pos) (bm.mv_x ) * 64;
     slot->metrics.horiBearingX = (FT_Pos) (bm.off_x ) * 64;
-    slot->metrics.horiBearingY = (FT_Pos) ascent * 64;
+    slot->metrics.horiBearingY = (FT_Pos) (bm.bbx_height) * 64;
     slot->metrics.width        = (FT_Pos) ( bitmap->width * 64 );
     slot->metrics.height       = (FT_Pos) ( bitmap->rows * 64 );
 
diff --git a/src/pk/pkdrivr.c b/src/pk/pkdrivr.c
index 44f64a0..a5bc639 100644
--- a/src/pk/pkdrivr.c
+++ b/src/pk/pkdrivr.c
@@ -367,7 +367,6 @@
     FT_Bitmap*   bitmap = &slot->bitmap;
     PK_BitmapRec bm;
     PK_Glyph     go;
-    FT_Int       ascent;
 
     go = pk->pk_glyph;
 
@@ -425,14 +424,13 @@
     /*       we can simply point to it                         */
     ft_glyphslot_set_bitmap( slot, bm.bitmap );
 
-    ascent = (bm.bbx_height + bm.off_y);
     slot->format      = FT_GLYPH_FORMAT_BITMAP;
     slot->bitmap_left = bm.off_x ;
-    slot->bitmap_top  = ascent ;
+    slot->bitmap_top  = bm.off_y ;
 
     slot->metrics.horiAdvance  = (FT_Pos) (bm.mv_x ) * 64;
     slot->metrics.horiBearingX = (FT_Pos) (bm.off_x ) * 64;
-    slot->metrics.horiBearingY = (FT_Pos) ascent * 64;
+    slot->metrics.horiBearingY = (FT_Pos) (bm.bbx_height) * 64;
     slot->metrics.width        = (FT_Pos) ( bitmap->width * 64 );
     slot->metrics.height       = (FT_Pos) ( bitmap->rows * 64 );
 



reply via email to

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