* 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
This commit is contained in:
David Turner 2003-01-15 22:48:27 +00:00
parent cad11476fe
commit 12d09050f5
7 changed files with 41 additions and 56 deletions

View File

@ -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,

View File

@ -373,6 +373,17 @@
#define FT_GZIP_H <freetype/ftgzip.h>
/*************************************************************************/
/* */
/* @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: */

View File

@ -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;

View File

@ -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.
#

View File

@ -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)

View File

@ -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

View File

@ -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 */