* include/freetype/config/ftheader.h, include/freetype/internal/fnttypes.h, include/freetype/ftwinfnt.h, src/base/winfnt.c, src/winfonts/winfnt.c, src/base/Jamfile, src/base/rules.mk, src/base/descrip.mms: added a Windows .FNT specific API (mostly for Wine). Also fixed a nasty bug in the header loader which would cause invalid memory overwrites
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
diff --git a/ChangeLog b/ChangeLog
index 2011123..80e3e27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,19 @@
+2003-01-15 Huw D M Davies <h.davies1@physics.ox.ac.uk>
+
+ * include/freetype/config/ftheader.h, include/freetype/internal/fnttypes.h,
+ include/freetype/ftwinfnt.h, src/base/winfnt.c, src/winfonts/winfnt.c,
+ src/base/Jamfile, src/base/rules.mk, src/base/descrip.mms:
+
+ added a Windows .FNT specific API (mostly for Wine). Also fixed a nasty
+ bug in the header loader which would cause invalid memory overwrites
+
2003-01-14 Graham Asher <graham.asher@btinternet.com>
- * /include/freetype/ftglyph.h, /src/base/ftglyph.c
+
+ * include/freetype/ftglyph.h, src/base/ftglyph.c:
Added 'const' to the type of the first argument to FT_Matrix_Multiply,
which isn't changed - this adds documentation and convenience.
+
2003-01-13 Graham Asher <graham.asher@btinternet.com>
* src/sfnt/ttload.c (tt_face_load_metrics)
@@ -12,6 +23,7 @@
function, implying that metrics will be supplied from outside.
This happens for certain Type 42 fonts passed from GhostScript.
+
2003-01-11 David Chester <davidchester@qmx.net>
* include/freetype/config/ftoption.h, src/autohint/ahglobal.h,
diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h
index 3ce1773..e5ae7e4 100644
--- a/include/freetype/config/ftheader.h
+++ b/include/freetype/config/ftheader.h
@@ -376,6 +376,17 @@
/*************************************************************************/
/* */
/* @macro: */
+ /* FT_WINFONTS_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the definitions of an API to support Windows .FNT files */
+ /* */
+#define FT_WINFONTS_H <freetype/ftwinfnt.h>
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
/* FT_GLYPH_H */
/* */
/* @description: */
diff --git a/include/freetype/internal/fnttypes.h b/include/freetype/internal/fnttypes.h
index 2edc567..a85d6ab 100644
--- a/include/freetype/internal/fnttypes.h
+++ b/include/freetype/internal/fnttypes.h
@@ -23,6 +23,7 @@
#include <ft2build.h>
#include FT_FREETYPE_H
+#include FT_WINFONTS_H
FT_BEGIN_HEADER
@@ -71,57 +72,15 @@ FT_BEGIN_HEADER
#define WINFNT_NE_MAGIC 0x454E
- typedef struct WinFNT_HeaderRec_
- {
- FT_UShort version;
- FT_ULong file_size;
- FT_Byte copyright[60];
- FT_UShort file_type;
- FT_UShort nominal_point_size;
- FT_UShort vertical_resolution;
- FT_UShort horizontal_resolution;
- FT_UShort ascent;
- FT_UShort internal_leading;
- FT_UShort external_leading;
- FT_Byte italic;
- FT_Byte underline;
- FT_Byte strike_out;
- FT_UShort weight;
- FT_Byte charset;
- FT_UShort pixel_width;
- FT_UShort pixel_height;
- FT_Byte pitch_and_family;
- FT_UShort avg_width;
- FT_UShort max_width;
- FT_Byte first_char;
- FT_Byte last_char;
- FT_Byte default_char;
- FT_Byte break_char;
- FT_UShort bytes_per_row;
- FT_ULong device_offset;
- FT_ULong face_name_offset;
- FT_ULong bits_pointer;
- FT_ULong bits_offset;
- FT_Byte reserved;
- FT_ULong flags;
- FT_UShort A_space;
- FT_UShort B_space;
- FT_UShort C_space;
- FT_UShort color_table_offset;
- FT_Byte reserved2[16];
-
- } WinFNT_HeaderRec, *WinFNT_Header;
-
-
typedef struct FNT_FontRec_
{
- FT_ULong offset;
- FT_Int size_shift;
+ FT_ULong offset;
+ FT_Int size_shift;
- WinFNT_HeaderRec header;
+ FT_WinFNT_HeaderRec header;
- FT_Byte* fnt_frame;
- FT_ULong fnt_size;
+ FT_Byte* fnt_frame;
+ FT_ULong fnt_size;
} FNT_FontRec, *FNT_Font;
diff --git a/src/base/Jamfile b/src/base/Jamfile
index 55e5e6a..5ebcd7c 100644
--- a/src/base/Jamfile
+++ b/src/base/Jamfile
@@ -22,9 +22,10 @@ SubDir FT2_TOP $(FT2_SRC_DIR) base ;
# Add the optional/replaceable files.
#
-Library $(FT2_LIB) : ftsystem.c ftinit.c ftglyph.c ftmm.c ftbdf.c
- ftbbox.c ftdebug.c ftxf86.c fttype1.c ftpfr.c
- ftstroker.c ;
+Library $(FT2_LIB) : ftsystem.c ftinit.c ftglyph.c ftmm.c ftbdf.c
+ ftbbox.c ftdebug.c ftxf86.c fttype1.c ftpfr.c
+ ftstroker.c ftwinfnt.c
+ ;
# Add Macintosh-specific file to the library when necessary.
#
diff --git a/src/base/descrip.mms b/src/base/descrip.mms
index 895da06..02a806a 100644
--- a/src/base/descrip.mms
+++ b/src/base/descrip.mms
@@ -15,7 +15,7 @@
CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.builds.vms],[--.include],[--.src.base])
-OBJS=ftbase.obj,ftinit.obj,ftglyph.obj,ftdebug.obj,ftbdf.obj,ftmm.obj,fttype1.obj,ftxf86.obj,ftpfr.obj, ftstroker.obj
+OBJS=ftbase.obj,ftinit.obj,ftglyph.obj,ftdebug.obj,ftbdf.obj,ftmm.obj,fttype1.obj,ftxf86.obj,ftpfr.obj,ftstroker.obj,ftwinfnt.obj
all : $(OBJS)
library [--.lib]freetype.olb $(OBJS)
diff --git a/src/base/rules.mk b/src/base/rules.mk
index d83b1e4..da345dd 100644
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -56,6 +56,7 @@ BASE_EXT_SRC := $(BASE_)ftglyph.c \
$(BASE_)ftxf86.c \
$(BASE_)ftpfr.c \
$(BASE_)ftstroker.c \
+ $(BASE_)ftwinfnt.c \
$(BASE_)ftbbox.c
# Default extensions objects
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index 9d29b9b..7b2a0e4 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -17,6 +17,7 @@
#include <ft2build.h>
+#include FT_WINFONTS_H
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_OBJECTS_H
@@ -68,7 +69,7 @@
const FT_Frame_Field winfnt_header_fields[] =
{
#undef FT_STRUCTURE
-#define FT_STRUCTURE WinFNT_HeaderRec
+#define FT_STRUCTURE FT_WinFNT_HeaderRec
FT_FRAME_START( 146 ),
FT_FRAME_USHORT_LE( version ),
@@ -106,7 +107,7 @@
FT_FRAME_USHORT_LE( B_space ),
FT_FRAME_USHORT_LE( C_space ),
FT_FRAME_USHORT_LE( color_table_offset ),
- FT_FRAME_BYTES ( reserved2, 16 ),
+ FT_FRAME_BYTES ( reserved1, 16 ),
FT_FRAME_END
};
@@ -127,8 +128,8 @@
fnt_font_load( FNT_Font font,
FT_Stream stream )
{
- FT_Error error;
- WinFNT_Header header = &font->header;
+ FT_Error error;
+ FT_WinFNT_Header header = &font->header;
/* first of all, read the FNT header */