freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] parthw-cleaned 23da9d1: [gf] Change metric values.


From: Parth Wazurkar
Subject: [freetype2] parthw-cleaned 23da9d1: [gf] Change metric values.
Date: Tue, 10 Jul 2018 13:16:40 -0400 (EDT)

branch: parthw-cleaned
commit 23da9d16ea384df27ec7bc301388dce295d15978
Author: Parth Wazurkar <address@hidden>
Commit: Parth Wazurkar <address@hidden>

    [gf] Change metric values.
---
 src/gf/gfdrivr.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/gf/gfdrivr.c b/src/gf/gfdrivr.c
index 7726033..e581c7b 100644
--- a/src/gf/gfdrivr.c
+++ b/src/gf/gfdrivr.c
@@ -391,8 +391,8 @@
     /* slot, bitmap => freetype, bm => gflib */
     bm = gf->gf_glyph->bm_table[glyph_index];
 
-    bitmap->rows       = bm.bbx_height / go->vppp;
-    bitmap->width      = bm.bbx_width  / go->hppp;
+    bitmap->rows       = bm.bbx_height;
+    bitmap->width      = bm.bbx_width;
     bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
 
     if ( !bm.raster )
@@ -402,19 +402,19 @@
       goto Exit;
     }
 
-    bitmap->pitch = (int)bm.raster ;
+    bitmap->pitch = (int)(((bm.raster+1)/2)*2) ;
 
     /* note: we don't allocate a new array to hold the bitmap; */
     /*       we can simply point to it                         */
     ft_glyphslot_set_bitmap( slot, bm.bitmap );
 
-    ascent = (bm.bbx_height + bm.off_y) / go->vppp;
+    ascent = (bm.bbx_height + bm.off_y);
     slot->format      = FT_GLYPH_FORMAT_BITMAP;
-    slot->bitmap_left = bm.off_x / go->hppp;
+    slot->bitmap_left = bm.off_x ;
     slot->bitmap_top  = ascent ;
 
-    slot->metrics.horiAdvance  = (FT_Pos) (bm.mv_x / go->hppp) * 64;
-    slot->metrics.horiBearingX = (FT_Pos) (bm.off_x / go->hppp) * 64;
+    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.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]