summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParth Wazurkar <parthwazurkar@gmail.com>2018-08-07 19:38:26 +0530
committerParth Wazurkar <parthwazurkar@gmail.com>2018-08-07 19:38:26 +0530
commit5485407707eb3e61dca0f3a8a0d8abecb0d71c0a (patch)
tree004612bb9d0e5df67d0a54d8ae255cd3109571a5
parentad0453fd392c914db66c1737bbf4721ddc76571c (diff)
downloadfreetype2-5485407707eb3e61dca0f3a8a0d8abecb0d71c0a.tar.gz
[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.
-rw-r--r--src/gf/gfdrivr.c6
-rw-r--r--src/pk/pkdrivr.c6
2 files changed, 4 insertions, 8 deletions
diff --git a/src/gf/gfdrivr.c b/src/gf/gfdrivr.c
index a568dda55..2994b3bb4 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 12056f913..8dc0dd3bd 100644
--- a/src/pk/pkdrivr.c
+++ b/src/pk/pkdrivr.c
@@ -365,7 +365,6 @@
FT_Bitmap* bitmap = &slot->bitmap;
PK_BitmapRec bm;
PK_Glyph go;
- FT_Int ascent;
go = pk->pk_glyph;
@@ -423,14 +422,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 );