On Fri, Dec 09, 2005 at 01:59:37PM +0800, Chia-I Wu wrote:
> To sum up, I think freetype should not round global font metrics (nor
> glyph metrics) and let clients decide how to deal with them, despite
> that clients are able to get the unrounded values by scaling themselves.
>
> As the effect is large (all apps using Xft), I need your opinions.
If there is no objection, I will commit the attached patch later today.
--
Regards,
olv
=== include/freetype/internal/ftobjs.h
==================================================================
--- include/freetype/internal/ftobjs.h (revision 2971)
+++ include/freetype/internal/ftobjs.h (local)
@@ -452,13 +452,6 @@
/* */
/*
- * grid-fit slot->metrics
- */
- FT_BASE( void )
- ft_glyphslot_grid_fit_metrics( FT_GlyphSlot slot );
-
-
- /*
* Free the bitmap of a given glyphslot when needed
* (i.e., only when it was allocated with ft_glyphslot_alloc_bitmap).
*/
=== src/base/ftobjs.c
==================================================================
--- src/base/ftobjs.c (revision 2971)
+++ src/base/ftobjs.c (local)
@@ -251,29 +251,6 @@
FT_BASE_DEF( void )
- ft_glyphslot_grid_fit_metrics( FT_GlyphSlot slot )
- {
- FT_Pos tmp;
-
-
- tmp = FT_PIX_CEIL( slot->metrics.horiBearingX + slot->metrics.width );
- slot->metrics.horiBearingX = FT_PIX_FLOOR( slot->metrics.horiBearingX );
- slot->metrics.width = tmp - slot->metrics.horiBearingX;
-
- tmp = FT_PIX_FLOOR( slot->metrics.horiBearingY - slot->metrics.height );
- slot->metrics.horiBearingY = FT_PIX_CEIL( slot->metrics.horiBearingY );
- slot->metrics.height = slot->metrics.horiBearingY - tmp;
-
- slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
-
- slot->metrics.vertBearingX = FT_PIX_FLOOR( slot->metrics.vertBearingX );
- /* note that vertBearingY should be floor'ed */
- slot->metrics.vertBearingY = FT_PIX_FLOOR( slot->metrics.vertBearingY );
- slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance );
- }
-
-
- FT_BASE_DEF( void )
ft_glyphslot_set_bitmap( FT_GlyphSlot slot,
FT_Byte* buffer )
{
@@ -1983,17 +1960,17 @@
{
/* Compute root ascender, descender, test height, and max_advance */
- metrics->ascender = FT_PIX_CEIL( FT_MulFix( face->ascender,
- metrics->y_scale ) );
+ metrics->ascender = FT_MulFix( face->ascender,
+ metrics->y_scale );
- metrics->descender = FT_PIX_FLOOR( FT_MulFix( face->descender,
- metrics->y_scale ) );
+ metrics->descender = FT_MulFix( face->descender,
+ metrics->y_scale );
- metrics->height = FT_PIX_ROUND( FT_MulFix( face->height,
- metrics->y_scale ) );
+ metrics->height = FT_MulFix( face->height,
+ metrics->y_scale );
- metrics->max_advance = FT_PIX_ROUND( FT_MulFix( face->max_advance_width,
- metrics->x_scale ) );
+ metrics->max_advance = FT_MulFix( face->max_advance_width,
+ metrics->x_scale );
}
=== src/cff/cffgload.c
==================================================================
--- src/cff/cffgload.c (revision 2971)
+++ src/cff/cffgload.c (local)
@@ -2687,9 +2687,6 @@
metrics->horiBearingX = cbox.xMin;
metrics->horiBearingY = cbox.yMax;
-
- if ( hinting )
- ft_glyphslot_grid_fit_metrics( &glyph->root );
}
}
=== src/cid/cidgload.c
==================================================================
--- src/cid/cidgload.c (revision 2971)
+++ src/cid/cidgload.c (local)
@@ -402,9 +402,6 @@
/* make up vertical ones */
metrics->vertBearingX = 0;
metrics->vertBearingY = 0;
-
- if ( hinting )
- ft_glyphslot_grid_fit_metrics( cidglyph );
}
}
=== src/truetype/ttgload.c
==================================================================
--- src/truetype/ttgload.c (revision 2971)
+++ src/truetype/ttgload.c (local)
@@ -1801,9 +1801,6 @@
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;
}
=== src/type1/t1gload.c
==================================================================
--- src/type1/t1gload.c (revision 2971)
+++ src/type1/t1gload.c (local)
@@ -359,9 +359,6 @@
/* make up vertical ones */
metrics->vertBearingX = 0;
metrics->vertBearingY = 0;
-
- if ( hinting )
- ft_glyphslot_grid_fit_metrics( &glyph->root );
}
/* Set control data to the glyph charstrings. Note that this is */
_______________________________________________
Freetype-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype-devel