* TODO: Updated. * src/cid/cidload.c (parse_font_matrix): Added units_per_EM * src/type1/t1load.c (parse_font_bbox): Changed to use FT_Fixed
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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
diff --git a/ChangeLog b/ChangeLog
index ba3599e..528b617 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,29 +1,29 @@
+2001-03-11 Werner Lemberg <wl@gnu.org>
+
+ * TODO: Updated.
+
2001-03-10 Tom Kacvinsky <tjk@ams.org>
* TODO: New file.
-
+
* include/freetype/freetype.h: Added prototypes and notes for
three new functions: FT_RoundFix, FT_CeilFix, and FT_FloorFix.
-
* src/base/ftcalc.c (FT_RoundFix, FT_CeilFix, FT_FloorFix): Added
implementation code.
* src/cid/cidobjs.c (CID_Init_Face): Use calculated units_per_EM,
and if that is not available, default to 1000 units per EM. Changed
assignment code for ascender and descender values.
-
- * src/cid/cidload.c (parse_font_matrix): Added units_per_EM
+ * src/cid/cidload.c (parse_font_matrix): Added units_per_EM
processing.
-
(parse_font_bbox): Changed to use FT_Fixed number handling.
* src/type1/t1objs.c (T1_Init_Face): Changed the assignment code
for ascender, descender, and max_advance_width.
-
- * src/type1/t1load.c (parse_font_bbox): Changed to use FT_Fixed
+ * src/type1/t1load.c (parse_font_bbox): Changed to use FT_Fixed
number handling.
-2001-03-10 Henrik Grubbström <grubba@roxen.com>
+2001-03-10 Henrik Grubbström <grubba@roxen.com>
* src/*/*.c: Added many casts to make code more 64bit-safe.
diff --git a/TODO b/TODO
index cfb599d..8849e6c 100644
--- a/TODO
+++ b/TODO
@@ -1,10 +1,12 @@
Here is a list of items that need to be addressed in FreeType 2:
-* Add synthesized Unicode charmap processing to the CFF driver.
+* Add synthesized Unicode charmap processing to the CFF driver.
-* Investigate usage of casts and bit width of integer types used. The idea is
-to typedef FT_Fixed, FT_Long, FT_Int, etc... to use the appropriate built in
-integer types. This is so that we may avoid unnecessary explict typecasts and
-side affects inherent in implict casts. This is mostly an issue on platforms
-where long integers are 64 bits wide (instead of 32 bits wide).
+* Investigate usage of casts and bit width of integer types used. The idea is
+ to typedef FT_Fixed, FT_Long, FT_Int, etc. to use the appropriate built in
+ integer types. This is so that we may avoid unnecessary explict typecasts
+ and side affects inherent in implict casts. This is mostly an issue on
+ platforms where long integers are 64 bits wide (instead of 32 bits wide).
+* Fix exact bbox calculation. The current code uses an iterative algorithm
+ which can fail miserably.
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 1d07590..0e72a1a 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -2331,7 +2331,7 @@ FT_BEGIN_HEADER
/* FT_RoundFix */
/* */
/* <Description> */
- /* A very simple function used to round a 16.16 fixed number */
+ /* A very simple function used to round a 16.16 fixed number. */
/* */
/* <Input> */
/* a :: The number to be rounded. */
@@ -2340,10 +2340,10 @@ FT_BEGIN_HEADER
/* The result of `(a + 0x8000) & -0x10000'. */
/* */
/* <Note> */
- /* This function assumes that the target platform supports 32 bit */
+ /* This function assumes that the target platform supports 32-bit */
/* signed integers. */
/* */
- FT_EXPORT( FT_Fixed ) FT_RoundFix( FT_Fixed a );
+ FT_EXPORT( FT_Fixed ) FT_RoundFix( FT_Fixed a );
/*************************************************************************/
@@ -2353,7 +2353,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* A very simple function used to compute the ceiling function of a */
- /* 16.16 fixed number */
+ /* 16.16 fixed number. */
/* */
/* <Input> */
/* a :: The number for which the ceiling function is to be computed. */
@@ -2362,10 +2362,10 @@ FT_BEGIN_HEADER
/* The result of `(a + 0x10000 - 1) & -0x10000'. */
/* */
/* <Note> */
- /* This function assumes that the target platform supports 32 bit */
+ /* This function assumes that the target platform supports 32-bit */
/* signed integers. */
/* */
- FT_EXPORT( FT_Fixed ) FT_CeilFix( FT_Fixed a );
+ FT_EXPORT( FT_Fixed ) FT_CeilFix( FT_Fixed a );
/*************************************************************************/
@@ -2375,7 +2375,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* A very simple function used to compute the floor function of a */
- /* 16.16 fixed number */
+ /* 16.16 fixed number. */
/* */
/* <Input> */
/* a :: The number for which the floor function is to be computed. */
@@ -2384,10 +2384,10 @@ FT_BEGIN_HEADER
/* The result of `a & -0x10000'. */
/* */
/* <Note> */
- /* This function assumes that the target platform supports 32 bit */
+ /* This function assumes that the target platform supports 32-bit */
/* signed integers. */
/* */
- FT_EXPORT( FT_Fixed ) FT_FloorFix( FT_Fixed a );
+ FT_EXPORT( FT_Fixed ) FT_FloorFix( FT_Fixed a );
/*************************************************************************/
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index d67a96a..ec7202a 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -47,12 +47,13 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_calc
+
/* The following three functions are available regardless of whether */
/* FT_LONG64 or FT_CONFIG_OPTION_OLD_CALCS is defined. */
/* documentation is in freetype.h */
- FT_EXPORT_DEF( FT_Fixed ) FT_RoundFix( FT_Fixed a )
+ FT_EXPORT_DEF( FT_Fixed ) FT_RoundFix( FT_Fixed a )
{
return( ( a + 0x8000L ) & -0x10000L );
}
@@ -60,7 +61,7 @@
/* documentation is in freetype.h */
- FT_EXPORT_DEF( FT_Fixed ) FT_CeilFix( FT_Fixed a )
+ FT_EXPORT_DEF( FT_Fixed ) FT_CeilFix( FT_Fixed a )
{
return( ( a + 0x10000L - 1 ) & -0x10000L );
}
@@ -68,7 +69,7 @@
/* documentation is in freetype.h */
- FT_EXPORT_DEF( FT_Fixed ) FT_FloorFix( FT_Fixed a )
+ FT_EXPORT_DEF( FT_Fixed ) FT_FloorFix( FT_Fixed a )
{
return( a & -0x10000L );
}
diff --git a/src/cid/cidload.c b/src/cid/cidload.c
index 5fa4c61..a372a99 100644
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -186,6 +186,7 @@
FT_Fixed temp[6];
FT_Fixed temp_scale;
+
if ( parser->num_dict >= 0 )
{
dict = face->cid.font_dicts + parser->num_dict;
@@ -196,10 +197,11 @@
temp_scale = ABS( temp[3] );
- /* Set Units per EM based on FontMatrix values. We set the value to */
- /* 1000 / temp_scale, because temp_scale was already multiplied by */
- /* 1000 (in t1_tofixed, from psobjs.c). */
- root->units_per_EM = FT_DivFix( 0x10000L, FT_DivFix( temp_scale, 1000 ) );
+ /* Set Units per EM based on FontMatrix values. We set the value to */
+ /* `1000/temp_scale', because temp_scale was already multiplied by */
+ /* 1000 (in t1_tofixed(), from psobjs.c). */
+ root->units_per_EM = FT_DivFix( 0x10000L,
+ FT_DivFix( temp_scale, 1000 ) );
/* we need to scale the values by 1.0/temp[3] */
if ( temp_scale != 0x10000L )