summaryrefslogtreecommitdiff
path: root/src/truetype/ttgload.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/truetype/ttgload.c')
-rw-r--r--src/truetype/ttgload.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index a83dbe328..a975aa484 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1707,15 +1707,6 @@
FT_Outline_Translate( &glyph->outline, -loader->pp1.x, 0 );
FT_Outline_Get_CBox( &glyph->outline, &bbox );
-
- if ( IS_HINTED( loader->load_flags ) )
- {
- /* grid-fit the bounding box */
- bbox.xMin = FT_PIX_FLOOR( bbox.xMin );
- bbox.yMin = FT_PIX_FLOOR( bbox.yMin );
- bbox.xMax = FT_PIX_CEIL( bbox.xMax );
- bbox.yMax = FT_PIX_CEIL( bbox.yMax );
- }
}
else
bbox = loader->bbox;
@@ -1744,10 +1735,6 @@
glyph->metrics.horiBearingY = bbox.yMax;
glyph->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
- /* don't forget to hint the advance when we need to */
- if ( IS_HINTED( loader->load_flags ) )
- glyph->metrics.horiAdvance = FT_PIX_ROUND( glyph->metrics.horiAdvance );
-
/* Now take care of vertical metrics. In the case where there is */
/* no vertical information within the font (relatively common), make */
/* up some metrics by `hand'... */
@@ -1857,15 +1844,6 @@
/* */
left = ( bbox.xMin - bbox.xMax ) / 2;
- /* grid-fit them if necessary */
- if ( IS_HINTED( loader->load_flags ) )
- {
- left = FT_PIX_FLOOR( left );
- /* top should be floor'ed */
- top = FT_PIX_FLOOR( top );
- advance = FT_PIX_ROUND( advance );
- }
-
glyph->metrics.vertBearingX = left;
glyph->metrics.vertBearingY = top;
glyph->metrics.vertAdvance = advance;
@@ -1888,6 +1866,9 @@
glyph->metrics.width = bbox.xMax - bbox.xMin;
glyph->metrics.height = bbox.yMax - bbox.yMin;
+ if ( IS_HINTED( loader->load_flags ) )
+ ft_glyphslot_grid_fit_metrics( glyph );
+
return 0;
}