Fixing comment in unixddef.mk which caused a trailing blank. Adding a new error, FT_Err_Invalid_Pixel_Size (used in winfnt.c) Fixing FT_Read_Fields() which failed for ft_frame_{bytes,skip}. This bug disabled the Winfont driver. Minor formatting issues.
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
diff --git a/builds/unix/unixddef.mk b/builds/unix/unixddef.mk
index 6ef0cbc..6b78ca6 100644
--- a/builds/unix/unixddef.mk
+++ b/builds/unix/unixddef.mk
@@ -22,7 +22,8 @@ DELETE := rm -f
SEP := /
HOSTSEP := $(SEP)
BUILD := $(TOP)/builds/unix/devel # we use a special devel ftoption.h
-PLATFORM := unixdev # do not set it to `unix', or libtool will trick you
+# do not set the platform to `unix', or libtool will trick you
+PLATFORM := unixdev
# The directory where all object files are placed.
diff --git a/include/freetype/fterrors.h b/include/freetype/fterrors.h
index 94d3e97..2fa9489 100644
--- a/include/freetype/fterrors.h
+++ b/include/freetype/fterrors.h
@@ -97,6 +97,8 @@
"invalid composite glyph" )
FT_ERRORDEF( FT_Err_Too_Many_Hints, 0x0016, \
"too many hints" )
+ FT_ERRORDEF( FT_Err_Invalid_Pixel_Size, 0x0017, \
+ "invalid pixel size" )
/* handle errors */
diff --git a/src/base/ftstream.c b/src/base/ftstream.c
index aad4f33..5c40e15 100644
--- a/src/base/ftstream.c
+++ b/src/base/ftstream.c
@@ -674,7 +674,7 @@
FT_UInt len = fields->size;
- if ( stream->cursor + len > stream->limit )
+ if ( cursor + len > stream->limit )
{
error = FT_Err_Invalid_Stream_Operation;
goto Exit;
@@ -683,9 +683,9 @@
if ( fields->value == ft_frame_bytes )
{
p = (FT_Byte*)structure + fields->offset;
- MEM_Copy( p, stream->cursor, len );
+ MEM_Copy( p, cursor, len );
}
- stream->cursor += len;
+ cursor += len;
fields++;
continue;
}
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index 8f264fc..0349f4f 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -235,8 +235,8 @@
root->bbox = face->cid.font_bbox;
root->units_per_EM = 1000;
- root->ascender = (FT_Short)face->cid.font_bbox.yMax;
- root->descender = (FT_Short)face->cid.font_bbox.yMin;
+ root->ascender = (FT_Short)face->cid.font_bbox.yMax;
+ root->descender = (FT_Short)face->cid.font_bbox.yMin;
root->height = ( ( root->ascender + root->descender ) * 12 )
/ 10;
diff --git a/src/type1z/z1objs.c b/src/type1z/z1objs.c
index b29e767..8772692 100644
--- a/src/type1z/z1objs.c
+++ b/src/type1z/z1objs.c
@@ -264,8 +264,8 @@
root->bbox = face->type1.font_bbox;
root->units_per_EM = 1000;
- root->ascender = (FT_Short)face->type1.font_bbox.yMax;
- root->descender = (FT_Short)face->type1.font_bbox.yMin;
+ root->ascender = (FT_Short)face->type1.font_bbox.yMax;
+ root->descender = (FT_Short)face->type1.font_bbox.yMin;
root->height = ( ( root->ascender + root->descender ) * 12 ) / 10;
/* now compute the maximum advance width */
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index 7e467ed..aedbb81 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -50,9 +50,9 @@
#define FT_STRUCTURE WinMZ_Header
FT_FRAME_START( 64 ),
- FT_FRAME_USHORT_LE ( magic ),
- FT_FRAME_SKIP_BYTES( 29 * 2 ),
- FT_FRAME_ULONG_LE ( lfanew ),
+ FT_FRAME_USHORT_LE ( magic ),
+ FT_FRAME_SKIP_BYTES( 29 * 2 ),
+ FT_FRAME_ULONG_LE ( lfanew ),
FT_FRAME_END
};
@@ -63,10 +63,10 @@
#define FT_STRUCTURE WinNE_Header
FT_FRAME_START( 40 ),
- FT_FRAME_USHORT_LE ( magic ),
- FT_FRAME_SKIP_BYTES( 34 ),
- FT_FRAME_USHORT_LE ( resource_tab_offset ),
- FT_FRAME_USHORT_LE ( rname_tab_offset ),
+ FT_FRAME_USHORT_LE ( magic ),
+ FT_FRAME_SKIP_BYTES( 34 ),
+ FT_FRAME_USHORT_LE ( resource_tab_offset ),
+ FT_FRAME_USHORT_LE ( rname_tab_offset ),
FT_FRAME_END
};
@@ -77,42 +77,42 @@
#define FT_STRUCTURE WinFNT_Header
FT_FRAME_START( 134 ),
- FT_FRAME_USHORT_LE( version ),
- FT_FRAME_ULONG_LE ( file_size ),
- FT_FRAME_BYTES ( copyright, 60 ),
- FT_FRAME_USHORT_LE( file_type ),
- FT_FRAME_USHORT_LE( nominal_point_size ),
- FT_FRAME_USHORT_LE( vertical_resolution ),
- FT_FRAME_USHORT_LE( horizontal_resolution ),
- FT_FRAME_USHORT_LE( ascent ),
- FT_FRAME_USHORT_LE( internal_leading ),
- FT_FRAME_USHORT_LE( external_leading ),
- FT_FRAME_BYTE ( italic ),
- FT_FRAME_BYTE ( underline ),
- FT_FRAME_BYTE ( strike_out ),
- FT_FRAME_USHORT_LE( weight ),
- FT_FRAME_BYTE ( charset ),
- FT_FRAME_USHORT_LE( pixel_width ),
- FT_FRAME_USHORT_LE( pixel_height ),
- FT_FRAME_BYTE ( pitch_and_family ),
- FT_FRAME_USHORT_LE( avg_width ),
- FT_FRAME_USHORT_LE( max_width ),
- FT_FRAME_BYTE ( first_char ),
- FT_FRAME_BYTE ( last_char ),
- FT_FRAME_BYTE ( default_char ),
- FT_FRAME_BYTE ( break_char ),
- FT_FRAME_USHORT_LE( bytes_per_row ),
- FT_FRAME_ULONG_LE ( device_offset ),
- FT_FRAME_ULONG_LE ( face_name_offset ),
- FT_FRAME_ULONG_LE ( bits_pointer ),
- FT_FRAME_ULONG_LE ( bits_offset ),
- FT_FRAME_BYTE ( reserved ),
- FT_FRAME_ULONG_LE ( flags ),
- FT_FRAME_USHORT_LE( A_space ),
- FT_FRAME_USHORT_LE( B_space ),
- FT_FRAME_USHORT_LE( C_space ),
- FT_FRAME_USHORT_LE( color_table_offset ),
- FT_FRAME_BYTES ( reserved, 4 ),
+ FT_FRAME_USHORT_LE( version ),
+ FT_FRAME_ULONG_LE ( file_size ),
+ FT_FRAME_BYTES ( copyright, 60 ),
+ FT_FRAME_USHORT_LE( file_type ),
+ FT_FRAME_USHORT_LE( nominal_point_size ),
+ FT_FRAME_USHORT_LE( vertical_resolution ),
+ FT_FRAME_USHORT_LE( horizontal_resolution ),
+ FT_FRAME_USHORT_LE( ascent ),
+ FT_FRAME_USHORT_LE( internal_leading ),
+ FT_FRAME_USHORT_LE( external_leading ),
+ FT_FRAME_BYTE ( italic ),
+ FT_FRAME_BYTE ( underline ),
+ FT_FRAME_BYTE ( strike_out ),
+ FT_FRAME_USHORT_LE( weight ),
+ FT_FRAME_BYTE ( charset ),
+ FT_FRAME_USHORT_LE( pixel_width ),
+ FT_FRAME_USHORT_LE( pixel_height ),
+ FT_FRAME_BYTE ( pitch_and_family ),
+ FT_FRAME_USHORT_LE( avg_width ),
+ FT_FRAME_USHORT_LE( max_width ),
+ FT_FRAME_BYTE ( first_char ),
+ FT_FRAME_BYTE ( last_char ),
+ FT_FRAME_BYTE ( default_char ),
+ FT_FRAME_BYTE ( break_char ),
+ FT_FRAME_USHORT_LE( bytes_per_row ),
+ FT_FRAME_ULONG_LE ( device_offset ),
+ FT_FRAME_ULONG_LE ( face_name_offset ),
+ FT_FRAME_ULONG_LE ( bits_pointer ),
+ FT_FRAME_ULONG_LE ( bits_offset ),
+ FT_FRAME_BYTE ( reserved ),
+ FT_FRAME_ULONG_LE ( flags ),
+ FT_FRAME_USHORT_LE( A_space ),
+ FT_FRAME_USHORT_LE( B_space ),
+ FT_FRAME_USHORT_LE( C_space ),
+ FT_FRAME_USHORT_LE( color_table_offset ),
+ FT_FRAME_BYTES ( reserved, 4 ),
FT_FRAME_END
};
@@ -153,7 +153,7 @@
if ( header->file_type & 1 )
{
- FT_TRACE2(( "can't handle vector FNT fonts\n" ));
+ FT_TRACE2(( "[can't handle vector FNT fonts]\n" ));
error = FT_Err_Unknown_File_Format;
goto Exit;
}
@@ -188,6 +188,7 @@
face->num_fonts = 0;
}
+
static
FT_Error fnt_get_dll_fonts( FNT_Face face )
{
@@ -470,7 +471,7 @@
}
}
- return ( size->font ? FT_Err_Ok : FT_Err_Invalid_Argument );
+ return ( size->font ? FT_Err_Ok : FT_Err_Invalid_Pixel_Size );
}