* include/freetype/freetype.h (FT_Glyph_Metrics, FT_GlyphSlotRec), src/autofit/afloader.c, src/autohint/ahhint.c: moved the definition of 'lsb_delta' and 'rsb_delta' from FT_GlyphMetrics to FT_GlyphSlotRec. The old location did BREAK BINARY COMPATIBILITY of the library !! * src/sfnt/sfobjs.c: removing compiler warning
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 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
diff --git a/ChangeLog b/ChangeLog
index 72eafd5..f380e70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-06-08 David Turner <david@freetype.org>
+
+ * include/freetype/freetype.h (FT_Glyph_Metrics, FT_GlyphSlotRec),
+ src/autofit/afloader.c, src/autohint/ahhint.c:
+ moved the definition of 'lsb_delta' and 'rsb_delta' from FT_GlyphMetrics
+ to FT_GlyphSlotRec. The old location did BREAK BINARY COMPATIBILITY
+ of the library !!
+
+ * src/sfnt/sfobjs.c: removing compiler warning
+
2004-06-05 Werner Lemberg <wl@gnu.org>
* src/autofit/afloader.c (af_loader_load_g): Set `lsb_delta' and
@@ -11,9 +21,6 @@
Improve inter-letter spacing for autohinted glyphs.
- * include/freetype/freetype.h (FT_Glyph_Metrics): Add elements
- `lsb_delta' and `rsb_delta'.
-
* src/autohint/ahhint.c (ah_hinter_load): Set `lsb_delta' and
`rsb_delta' in slot->metrics and tune side bearings slightly.
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 453db74..3e3d217 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -213,41 +213,6 @@ FT_BEGIN_HEADER
/* vertAdvance :: */
/* Advance height for vertical layout. */
/* */
- /* lsb_delta :: */
- /* The difference between hinted and unhinted left side bearing */
- /* while autohinting is active. Zero otherwise. */
- /* */
- /* rsb_delta :: */
- /* The difference between hinted and unhinted right side bearing */
- /* while autohinting is active. Zero otherwise. */
- /* */
- /* <Note> */
- /* Here a small pseudo code fragment which shows how to use */
- /* `lsb_delta' and `rsb_delta': */
- /* */
- /* FT_Pos origin_x = 0; */
- /* FT_Pos prev_rsb_delta = 0; */
- /* */
- /* */
- /* for all glyphs do */
- /* <compute kern between current and previous glyph and add it to */
- /* `origin_x'> */
- /* */
- /* <load glyph with `FT_Load_Glyph'> */
- /* */
- /* if ( prev_rsb_delta - face->glyph->metrics.lsb_delta >= 32 ) */
- /* origin_x -= 64; */
- /* else if */
- /* ( prev_rsb_delta - face->glyph->metrics.lsb_delta < -32 ) */
- /* origin_x += 64; */
- /* */
- /* prev_rsb_delta = face->glyph->metrics.rsb_delta; */
- /* */
- /* <save glyph image, or render glyph, or ...> */
- /* */
- /* origin_x += face->glyph->advance.x; */
- /* endfor */
- /* */
typedef struct FT_Glyph_Metrics_
{
FT_Pos width;
@@ -261,9 +226,6 @@ FT_BEGIN_HEADER
FT_Pos vertBearingY;
FT_Pos vertAdvance;
- FT_Pos lsb_delta;
- FT_Pos rsb_delta;
-
} FT_Glyph_Metrics;
@@ -1506,6 +1468,14 @@ FT_BEGIN_HEADER
/* Note that the app will need to know about the */
/* image format. */
/* */
+ /* lsb_delta :: */
+ /* The difference between hinted and unhinted left side bearing */
+ /* while autohinting is active. Zero otherwise. */
+ /* */
+ /* rsb_delta :: */
+ /* The difference between hinted and unhinted right side bearing */
+ /* while autohinting is active. Zero otherwise. */
+ /* */
/* <Note> */
/* If @FT_Load_Glyph is called with default flags (see */
/* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */
@@ -1525,6 +1495,34 @@ FT_BEGIN_HEADER
/* position (e.g. coordinates [0,0] on the baseline). Of course, */
/* `slot->format' is also changed to `FT_GLYPH_FORMAT_BITMAP' . */
/* */
+ /* <Note> */
+ /* Here a small pseudo code fragment which shows how to use */
+ /* `lsb_delta' and `rsb_delta': */
+ /* { */
+ /* FT_Pos origin_x = 0; */
+ /* FT_Pos prev_rsb_delta = 0; */
+ /* */
+ /* */
+ /* for all glyphs do */
+ /* <compute kern between current and previous glyph and add it to */
+ /* `origin_x'> */
+ /* */
+ /* <load glyph with `FT_Load_Glyph'> */
+ /* */
+ /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
+ /* origin_x -= 64; */
+ /* else if */
+ /* ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
+ /* origin_x += 64; */
+ /* */
+ /* prev_rsb_delta = face->glyph->rsb_delta; */
+ /* */
+ /* <save glyph image, or render glyph, or ...> */
+ /* */
+ /* origin_x += face->glyph->advance.x; */
+ /* endfor */
+ /* } */
+ /* */
typedef struct FT_GlyphSlotRec_
{
FT_Library library;
@@ -1552,6 +1550,9 @@ FT_BEGIN_HEADER
void* control_data;
long control_len;
+ FT_Pos lsb_delta;
+ FT_Pos rsb_delta;
+
void* other;
FT_Slot_Internal internal;
diff --git a/src/autofit/afdummy.c b/src/autofit/afdummy.c
index 3a13140..2d5f898 100644
--- a/src/autofit/afdummy.c
+++ b/src/autofit/afdummy.c
@@ -1,4 +1,5 @@
#include "afdummy.h"
+#include "afhints.h"
static FT_Error
diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c
index bd3a2c0..6782ee8 100644
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -190,8 +190,8 @@
loader->pp1.x = FT_PIX_ROUND( pp1x_uh );
loader->pp2.x = FT_PIX_ROUND( pp2x_uh );
- slot->metrics.lsb_delta = hinter->pp1.x - pp1x_uh;
- slot->metrics.rsb_delta = hinter->pp2.x - pp2x_uh;
+ slot->lsb_delta = loader->pp1.x - pp1x_uh;
+ slot->rsb_delta = loader->pp2.x - pp2x_uh;
#if 0
/* try to fix certain bad advance computations */
diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c
index c9e4dbb..8e8afea 100644
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -1569,8 +1569,8 @@
hinter->pp1.x = FT_PIX_ROUND( pp1x_uh );
hinter->pp2.x = FT_PIX_ROUND( pp2x_uh );
- slot->metrics.lsb_delta = hinter->pp1.x - pp1x_uh;
- slot->metrics.rsb_delta = hinter->pp2.x - pp2x_uh;
+ slot->lsb_delta = hinter->pp1.x - pp1x_uh;
+ slot->rsb_delta = hinter->pp2.x - pp2x_uh;
#if 0
/* try to fix certain bad advance computations */
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 757cba7..620b3d7 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -251,6 +251,14 @@
typedef unsigned char Byte, *PByte;
typedef char Bool;
+ typedef union
+ {
+ long l;
+ void* p;
+ void (*f)(void);
+
+ } Alignment, *PAlignment;
+
typedef struct TPoint_
{
Long x;
@@ -313,7 +321,7 @@
#define AlignProfileSize \
- ( ( sizeof ( TProfile ) + sizeof ( long ) - 1 ) / sizeof ( long ) )
+ ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) )
#ifdef TT_STATIC_RASTER
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 31281df..37b58a3 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -160,7 +160,7 @@
FT_Int found_win = -1;
FT_Int found_unicode = -1;
- FT_Bool is_english;
+ FT_Bool is_english = 0;
TT_NameEntry_ConvertFunc convert;