* src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler

warnings.

Formatting.
This commit is contained in:
Werner Lemberg 2008-10-04 11:39:03 +00:00
parent 1137d04f85
commit 45489589ad
6 changed files with 42 additions and 38 deletions

View File

@ -1,11 +1,15 @@
2008-10-04 Werner Lemberg <wl@gnu.org>
* src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler
warnings.
2008-10-04 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
* src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Replaced by...
(ft_lookup_PS_in_sfnt_stream): This.
(open_face_PS_from_sfnt_stream): New function. It checks
whether the stream is sfnt-wrapped Type1 PS font or sfnt-
wrapped CID-keyed font, then try to open a face for given
face_index.
(open_face_PS_from_sfnt_stream): New function. It checks whether
the stream is sfnt-wrapped Type1 PS font or sfnt-wrapped CID-keyed
font, then try to open a face for given face_index.
(Mac_Read_sfnt_Resource): Replace the combination of
`ft_lookup_PS_in_sfnt' and `open_face_from_buffer' by
`open_face_PS_from_sfnt_stream'.
@ -16,22 +20,20 @@
2008-10-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
* src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Set *is_sfnt_cid
to FALSE when neither `CID ' nor `TYP1' is found in the sfnt
container.
* src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Set *is_sfnt_cid to
FALSE if neither `CID ' nor `TYP1' is found in the sfnt container.
2008-10-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
* include/freetype/config/ftconfig.h: Define FT_MACINTOSH when
SC or MrC compiler of MPW is used. These compilers do not
define the macro __APPLE__ by themselves.
* include/freetype/config/ftconfig.h: Define FT_MACINTOSH when SC or
MrC compiler of MPW is used. These compilers do not define the
macro __APPLE__ by themselves.
* builds/unix/ftconfig.in: Ditto.
* builds/vms/ftconfig.h: Ditto.
* src/base/ftbase.c: Use FT_MACINTOSH instead of __APPLE__,
to include ftmac.c when FreeType2 is built by MPW.
* src/base/ftobjs.c: Use FT_MACINTOSH instead of __APPLE__,
to enable shared functions for ftmac.c when FreeType2 is
built by MPW.
* src/base/ftbase.c: Use FT_MACINTOSH instead of __APPLE__, to
include ftmac.c if FreeType 2 is built by MPW.
* src/base/ftobjs.c: Use FT_MACINTOSH instead of __APPLE__, to
enable shared functions for ftmac.c if FreeType 2 is built by MPW.
* builds/mac/ftmac.c: Include ftbase.h.
(memory_stream_close): Removed.
@ -41,10 +43,9 @@
(ft_lookup_PS_in_sfnt): Ditto.
* builds/mac/FreeType.m68k_far.make.txt: Build ftmac.c as an
included part of ftbase.c, to share the functions in ftobjs.c.
The rule compiling ftmac.c separately is removed and the rule
copying ftbase.c from src/base/ftbase.c to builds/mac/ftbase.c
is added.
included part of ftbase.c, to share the functions in ftobjs.c. The
rule compiling ftmac.c separately is removed and the rule copying
ftbase.c from src/base/ftbase.c to builds/mac/ftbase.c is added.
* builds/mac/FreeType.m68k_cfm.make.txt: Ditto.
* builds/mac/FreeType.ppc_classic.make.txt: Ditto.
* builds/mac/FreeType.ppc_carbon.make.txt: Ditto.

View File

@ -157,7 +157,7 @@ FT_BEGIN_HEADER
#define FT_MACINTOSH 1
#endif
#elif defined( __SC__ ) || defined( __MRC__ )
#elif defined( __SC__ ) || defined( __MRC__ )
/* Classic MacOS compilers */
#include "ConditionalMacros.h"
#if TARGET_OS_MAC

View File

@ -4,7 +4,7 @@
/* */
/* VMS-specific configuration file (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -110,7 +110,7 @@ FT_BEGIN_HEADER
#define FT_MACINTOSH 1
#endif
#elif defined( __SC__ ) || defined( __MRC__ )
#elif defined( __SC__ ) || defined( __MRC__ )
/* Classic MacOS compilers */
#include "ConditionalMacros.h"
#if TARGET_OS_MAC

View File

@ -136,7 +136,7 @@ FT_BEGIN_HEADER
#define FT_MACINTOSH 1
#endif
#elif defined( __SC__ ) || defined( __MRC__ )
#elif defined( __SC__ ) || defined( __MRC__ )
/* Classic MacOS compilers */
#include "ConditionalMacros.h"
#if TARGET_OS_MAC

View File

@ -30,10 +30,10 @@ FT_BEGIN_HEADER
/* Assume the stream is sfnt-wrapped PS Type1 or sfnt-wrapped CID-keyed */
/* font, and try to load a face specified by the face_index. */
FT_LOCAL_DEF( FT_Error )
open_face_PS_from_sfnt_stream( FT_Library library,
FT_Stream stream,
FT_Long face_index,
FT_Int num_params,
open_face_PS_from_sfnt_stream( FT_Library library,
FT_Stream stream,
FT_Long face_index,
FT_Int num_params,
FT_Parameter *params,
FT_Face *aface );

View File

@ -1339,6 +1339,7 @@
*offset = 0;
*length = 0;
*is_sfnt_cid = TRUE;
/* TODO: support for sfnt-wrapped PS/CID in TTC format */
*is_sfnt_cid = FALSE;
@ -1349,24 +1350,23 @@
if ( tag != FT_MAKE_TAG( 't', 'y', 'p', '1' ) )
return FT_Err_Unknown_File_Format;
if ( FT_READ_USHORT( numTables ) )
return error;
if ( FT_STREAM_SKIP( 2 * 3 ) ) /* skip binary search header */
return error;
pstable_index = -1;
*is_sfnt_cid = FALSE;
for ( i = 0; i < numTables; i ++ )
*is_sfnt_cid = FALSE;
for ( i = 0; i < numTables; i++ )
{
if ( FT_READ_ULONG( tag ) || FT_STREAM_SKIP( 4 ) ||
if ( FT_READ_ULONG( tag ) || FT_STREAM_SKIP( 4 ) ||
FT_READ_ULONG( *offset ) || FT_READ_ULONG( *length ) )
return error;
if ( tag == FT_MAKE_TAG( 'C', 'I', 'D', ' ' ) )
{
pstable_index ++;
pstable_index++;
*offset += 22;
*length -= 22;
*is_sfnt_cid = TRUE;
@ -1375,7 +1375,7 @@
}
else if ( tag == FT_MAKE_TAG( 'T', 'Y', 'P', '1' ) )
{
pstable_index ++;
pstable_index++;
*offset += 24;
*length -= 24;
*is_sfnt_cid = FALSE;
@ -1390,10 +1390,10 @@
FT_LOCAL_DEF( FT_Error )
open_face_PS_from_sfnt_stream( FT_Library library,
FT_Stream stream,
FT_Long face_index,
FT_Int num_params,
open_face_PS_from_sfnt_stream( FT_Library library,
FT_Stream stream,
FT_Long face_index,
FT_Int num_params,
FT_Parameter *params,
FT_Face *aface )
{
@ -1404,6 +1404,9 @@
FT_Bool is_sfnt_cid;
FT_Byte* sfnt_ps;
FT_UNUSED( num_params );
FT_UNUSED( params );
pos = FT_Stream_Pos( stream );