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.
This commit is contained in:
Werner Lemberg 2000-09-29 06:41:56 +00:00
parent 42022c8c94
commit 8bb45ec8fb
6 changed files with 57 additions and 53 deletions

View File

@ -22,7 +22,8 @@ DELETE := rm -f
SEP := / SEP := /
HOSTSEP := $(SEP) HOSTSEP := $(SEP)
BUILD := $(TOP)/builds/unix/devel # we use a special devel ftoption.h 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. # The directory where all object files are placed.

View File

@ -97,6 +97,8 @@
"invalid composite glyph" ) "invalid composite glyph" )
FT_ERRORDEF( FT_Err_Too_Many_Hints, 0x0016, \ FT_ERRORDEF( FT_Err_Too_Many_Hints, 0x0016, \
"too many hints" ) "too many hints" )
FT_ERRORDEF( FT_Err_Invalid_Pixel_Size, 0x0017, \
"invalid pixel size" )
/* handle errors */ /* handle errors */

View File

@ -674,7 +674,7 @@
FT_UInt len = fields->size; FT_UInt len = fields->size;
if ( stream->cursor + len > stream->limit ) if ( cursor + len > stream->limit )
{ {
error = FT_Err_Invalid_Stream_Operation; error = FT_Err_Invalid_Stream_Operation;
goto Exit; goto Exit;
@ -683,9 +683,9 @@
if ( fields->value == ft_frame_bytes ) if ( fields->value == ft_frame_bytes )
{ {
p = (FT_Byte*)structure + fields->offset; p = (FT_Byte*)structure + fields->offset;
MEM_Copy( p, stream->cursor, len ); MEM_Copy( p, cursor, len );
} }
stream->cursor += len; cursor += len;
fields++; fields++;
continue; continue;
} }

View File

@ -235,8 +235,8 @@
root->bbox = face->cid.font_bbox; root->bbox = face->cid.font_bbox;
root->units_per_EM = 1000; root->units_per_EM = 1000;
root->ascender = (FT_Short)face->cid.font_bbox.yMax; root->ascender = (FT_Short)face->cid.font_bbox.yMax;
root->descender = (FT_Short)face->cid.font_bbox.yMin; root->descender = (FT_Short)face->cid.font_bbox.yMin;
root->height = ( ( root->ascender + root->descender ) * 12 ) root->height = ( ( root->ascender + root->descender ) * 12 )
/ 10; / 10;

View File

@ -264,8 +264,8 @@
root->bbox = face->type1.font_bbox; root->bbox = face->type1.font_bbox;
root->units_per_EM = 1000; root->units_per_EM = 1000;
root->ascender = (FT_Short)face->type1.font_bbox.yMax; root->ascender = (FT_Short)face->type1.font_bbox.yMax;
root->descender = (FT_Short)face->type1.font_bbox.yMin; root->descender = (FT_Short)face->type1.font_bbox.yMin;
root->height = ( ( root->ascender + root->descender ) * 12 ) / 10; root->height = ( ( root->ascender + root->descender ) * 12 ) / 10;
/* now compute the maximum advance width */ /* now compute the maximum advance width */

View File

@ -50,9 +50,9 @@
#define FT_STRUCTURE WinMZ_Header #define FT_STRUCTURE WinMZ_Header
FT_FRAME_START( 64 ), FT_FRAME_START( 64 ),
FT_FRAME_USHORT_LE ( magic ), FT_FRAME_USHORT_LE ( magic ),
FT_FRAME_SKIP_BYTES( 29 * 2 ), FT_FRAME_SKIP_BYTES( 29 * 2 ),
FT_FRAME_ULONG_LE ( lfanew ), FT_FRAME_ULONG_LE ( lfanew ),
FT_FRAME_END FT_FRAME_END
}; };
@ -63,10 +63,10 @@
#define FT_STRUCTURE WinNE_Header #define FT_STRUCTURE WinNE_Header
FT_FRAME_START( 40 ), FT_FRAME_START( 40 ),
FT_FRAME_USHORT_LE ( magic ), FT_FRAME_USHORT_LE ( magic ),
FT_FRAME_SKIP_BYTES( 34 ), FT_FRAME_SKIP_BYTES( 34 ),
FT_FRAME_USHORT_LE ( resource_tab_offset ), FT_FRAME_USHORT_LE ( resource_tab_offset ),
FT_FRAME_USHORT_LE ( rname_tab_offset ), FT_FRAME_USHORT_LE ( rname_tab_offset ),
FT_FRAME_END FT_FRAME_END
}; };
@ -77,42 +77,42 @@
#define FT_STRUCTURE WinFNT_Header #define FT_STRUCTURE WinFNT_Header
FT_FRAME_START( 134 ), FT_FRAME_START( 134 ),
FT_FRAME_USHORT_LE( version ), FT_FRAME_USHORT_LE( version ),
FT_FRAME_ULONG_LE ( file_size ), FT_FRAME_ULONG_LE ( file_size ),
FT_FRAME_BYTES ( copyright, 60 ), FT_FRAME_BYTES ( copyright, 60 ),
FT_FRAME_USHORT_LE( file_type ), FT_FRAME_USHORT_LE( file_type ),
FT_FRAME_USHORT_LE( nominal_point_size ), FT_FRAME_USHORT_LE( nominal_point_size ),
FT_FRAME_USHORT_LE( vertical_resolution ), FT_FRAME_USHORT_LE( vertical_resolution ),
FT_FRAME_USHORT_LE( horizontal_resolution ), FT_FRAME_USHORT_LE( horizontal_resolution ),
FT_FRAME_USHORT_LE( ascent ), FT_FRAME_USHORT_LE( ascent ),
FT_FRAME_USHORT_LE( internal_leading ), FT_FRAME_USHORT_LE( internal_leading ),
FT_FRAME_USHORT_LE( external_leading ), FT_FRAME_USHORT_LE( external_leading ),
FT_FRAME_BYTE ( italic ), FT_FRAME_BYTE ( italic ),
FT_FRAME_BYTE ( underline ), FT_FRAME_BYTE ( underline ),
FT_FRAME_BYTE ( strike_out ), FT_FRAME_BYTE ( strike_out ),
FT_FRAME_USHORT_LE( weight ), FT_FRAME_USHORT_LE( weight ),
FT_FRAME_BYTE ( charset ), FT_FRAME_BYTE ( charset ),
FT_FRAME_USHORT_LE( pixel_width ), FT_FRAME_USHORT_LE( pixel_width ),
FT_FRAME_USHORT_LE( pixel_height ), FT_FRAME_USHORT_LE( pixel_height ),
FT_FRAME_BYTE ( pitch_and_family ), FT_FRAME_BYTE ( pitch_and_family ),
FT_FRAME_USHORT_LE( avg_width ), FT_FRAME_USHORT_LE( avg_width ),
FT_FRAME_USHORT_LE( max_width ), FT_FRAME_USHORT_LE( max_width ),
FT_FRAME_BYTE ( first_char ), FT_FRAME_BYTE ( first_char ),
FT_FRAME_BYTE ( last_char ), FT_FRAME_BYTE ( last_char ),
FT_FRAME_BYTE ( default_char ), FT_FRAME_BYTE ( default_char ),
FT_FRAME_BYTE ( break_char ), FT_FRAME_BYTE ( break_char ),
FT_FRAME_USHORT_LE( bytes_per_row ), FT_FRAME_USHORT_LE( bytes_per_row ),
FT_FRAME_ULONG_LE ( device_offset ), FT_FRAME_ULONG_LE ( device_offset ),
FT_FRAME_ULONG_LE ( face_name_offset ), FT_FRAME_ULONG_LE ( face_name_offset ),
FT_FRAME_ULONG_LE ( bits_pointer ), FT_FRAME_ULONG_LE ( bits_pointer ),
FT_FRAME_ULONG_LE ( bits_offset ), FT_FRAME_ULONG_LE ( bits_offset ),
FT_FRAME_BYTE ( reserved ), FT_FRAME_BYTE ( reserved ),
FT_FRAME_ULONG_LE ( flags ), FT_FRAME_ULONG_LE ( flags ),
FT_FRAME_USHORT_LE( A_space ), FT_FRAME_USHORT_LE( A_space ),
FT_FRAME_USHORT_LE( B_space ), FT_FRAME_USHORT_LE( B_space ),
FT_FRAME_USHORT_LE( C_space ), FT_FRAME_USHORT_LE( C_space ),
FT_FRAME_USHORT_LE( color_table_offset ), FT_FRAME_USHORT_LE( color_table_offset ),
FT_FRAME_BYTES ( reserved, 4 ), FT_FRAME_BYTES ( reserved, 4 ),
FT_FRAME_END FT_FRAME_END
}; };
@ -153,7 +153,7 @@
if ( header->file_type & 1 ) 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; error = FT_Err_Unknown_File_Format;
goto Exit; goto Exit;
} }
@ -188,6 +188,7 @@
face->num_fonts = 0; face->num_fonts = 0;
} }
static static
FT_Error fnt_get_dll_fonts( FNT_Face face ) 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 );
} }