Add FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT.

Useful for embedded systems which don't need file stream support.

* src/base/ftsystem.c, src/base/ftobjs.c (FT_Stream_New): Implement
it.
This commit is contained in:
Chris Morgan 2011-07-20 06:48:08 +02:00 committed by Werner Lemberg
parent 77f04cebe8
commit 3abf617b5e
5 changed files with 40 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2011-07-20 Chris Morgan <cmorgan@cybexintl.com>
Add FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT.
Useful for embedded systems which don't need file stream support.
* src/base/ftsystem.c, src/base/ftobjs.c (FT_Stream_New): Implement
it.
2011-07-20 Elton Chung <elton328@gmail.com>
* src/base/ftpatent.c (FT_Face_SetUnpatentedHinting): Fix typo.

View File

@ -203,6 +203,17 @@ FT_BEGIN_HEADER
#define FT_CONFIG_OPTION_USE_BZIP2
/*************************************************************************/
/* */
/* Define to disable the use of file stream functions and types, FILE, */
/* fopen() etc. Enables the use of smaller system libraries on embedded */
/* systems that have multiple system libraries, some with or without */
/* file stream support, in the cases where file stream support is not */
/* necessary such as memory loading of font files. */
/* */
/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
/*************************************************************************/
/* */
/* DLL export compilation */

View File

@ -203,6 +203,17 @@ FT_BEGIN_HEADER
/* #define FT_CONFIG_OPTION_USE_BZIP2 */
/*************************************************************************/
/* */
/* Define to disable the use of file stream functions and types, FILE, */
/* fopen() etc. Enables the use of smaller system libraries on embedded */
/* systems that have multiple system libraries, some with or without */
/* file stream support, in the cases where file stream support is not */
/* necessary such as memory loading of font files. */
/* */
/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
/*************************************************************************/
/* */
/* DLL export compilation */

View File

@ -155,6 +155,9 @@
(const FT_Byte*)args->memory_base,
args->memory_size );
}
#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT
else if ( args->flags & FT_OPEN_PATHNAME )
{
/* create a normal system stream */
@ -170,6 +173,9 @@
FT_FREE( stream );
stream = args->stream;
}
#endif
else
error = FT_Err_Invalid_Argument;

View File

@ -4,7 +4,7 @@
/* */
/* ANSI-specific FreeType low-level system interface (body). */
/* */
/* Copyright 1996-2001, 2002, 2006, 2008, 2009, 2010 by */
/* Copyright 1996-2002, 2006, 2008-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -137,6 +137,7 @@
/* */
/*************************************************************************/
#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT
/*************************************************************************/
/* */
@ -267,6 +268,7 @@
return FT_Err_Ok;
}
#endif /* !FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
#ifdef FT_DEBUG_MEMORY