summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParth Wazurkar <parthwazurkar@gmail.com>2018-07-14 14:10:50 +0530
committerParth Wazurkar <parthwazurkar@gmail.com>2018-07-30 23:47:51 +0530
commitd9d157e5562ba47395154ba3c97924991101b749 (patch)
treebcdb3643bdc796dfacefe5ee7de942d94fb7502a
parent69124b59792f3fd74bf833041d5ab975223e0426 (diff)
downloadfreetype2-d9d157e5562ba47395154ba3c97924991101b749.tar.gz
[gf] Fixes.
-rw-r--r--src/gf/gfdrivr.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gf/gfdrivr.c b/src/gf/gfdrivr.c
index 3bc846122..08bc887cd 100644
--- a/src/gf/gfdrivr.c
+++ b/src/gf/gfdrivr.c
@@ -238,17 +238,21 @@
{
FT_Bitmap_Size* bsize = gfface->available_sizes;
- /* FT_UShort x_res, y_res; */
+ FT_UShort x_res, y_res;
bsize->height = (FT_Short) face->gf_glyph->font_bbx_h ;
bsize->width = (FT_Short) face->gf_glyph->font_bbx_w ;
- bsize->size = (FT_Pos) face->gf_glyph->ds << 6 ;
+ bsize->size = (FT_Pos) FT_MulDiv( FT_ABS( face->gf_glyph->ds ),
+ 64 * 7200,
+ 72270L );
- /* x_res = toint( go->hppp * 72.27 ); */
- /* y_res = toint( go->vppp * 72.27 ); */
+ x_res = toint( go->hppp * 72.27 );
+ y_res = toint( go->vppp * 72.27 );
- bsize->y_ppem = (FT_Pos)(bsize->size/10) << 6 ;
- bsize->x_ppem = (FT_Pos)bsize->y_ppem ;
+ bsize->y_ppem = (FT_Pos) toint((face->gf_glyph->ds * y_res)/ 72.27) << 6 ;
+ bsize->x_ppem = (FT_Pos)FT_MulDiv( bsize->y_ppem,
+ x_res,
+ y_res ); ;
}
/* Charmaps */