* include/freetype/internal/ftobjs.h (ft_glyphslot_grid_fit_metrics), src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Removed. * src/base/ftobjs.c (ft_recompute_scaled_metrics): Do not round. * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph), src/truetype/ttgload.c (compute_glyph_metrics), src/type1/t1gload.c (T1_Load_Glyph): Do not round glyph metrics. * doc/CHANGES: Mention the changes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
diff --git a/ChangeLog b/ChangeLog
index b103a8d..edbf1dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2005-12-16 Chia-I Wu <b90201047@ntu.edu.tw>
+
+ * include/freetype/internal/ftobjs.h (ft_glyphslot_grid_fit_metrics),
+ src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Removed.
+
+ * src/base/ftobjs.c (ft_recompute_scaled_metrics): Do not round.
+
+ * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
+ (cid_slot_load_glyph), src/truetype/ttgload.c (compute_glyph_metrics),
+ src/type1/t1gload.c (T1_Load_Glyph): Do not round glyph metrics.
+
+ * doc/CHANGES: Mention the changes.
+
2005-12-13 David Turner <david@freetype.org>
* src/autofit/aflatin.c, src/autofit/afhints.c: changed the
diff --git a/docs/CHANGES b/docs/CHANGES
index 0365534..37ed7eb 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -14,6 +14,10 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.10
II. IMPORTANT CHANGES
+ - Face metrics (face->size->metrics) and glyph metrics are no
+ longer rounded. If you do not round in your applications too,
+ you may find glyphs become blurry.
+
- A new API `FT_TrueTypeGX_Validate' (in FT_GX_VALIDATE_H) has
been added to validate TrueType GX/ATT tables (feat, mort, morx,
bsln, just, kern, opbd, trak, prop). After validation it is no
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index ca5196a..49f6800 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -452,13 +452,6 @@ FT_BEGIN_HEADER
/* */
/*
- * 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).
*/
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 5199e29..84436e1 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -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 );
}
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 7ac2fcd..ef67835 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -2687,9 +2687,6 @@
metrics->horiBearingX = cbox.xMin;
metrics->horiBearingY = cbox.yMax;
-
- if ( hinting )
- ft_glyphslot_grid_fit_metrics( &glyph->root );
}
}
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index d61d959..12d749d 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -402,9 +402,6 @@
/* make up vertical ones */
metrics->vertBearingX = 0;
metrics->vertBearingY = 0;
-
- if ( hinting )
- ft_glyphslot_grid_fit_metrics( cidglyph );
}
}
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index bdd0a06..ebbd7a0 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -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;
}
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index 54c9b68..88c57da 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -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 */