mirror of https://github.com/freetype/freetype
Avoid reserved identifiers that are globally defined.
This is mandated by the C99 standard, and clang 15 produces zillions of warnings otherwise. * devel/ftoption.h, include/freetype/config/ftoption.h, include/freetype/internal/ftmemory.h, src/autofit/afhints.h, src/autofit/afmodule.c, src/autofit/aftypes.h, src/base/ftadvanc.c, src/base/ftdbgmem.c, src/base/ftstream.c, src/bdf/bdflib.c, src/truetype/ttinterp.c: Replace identifiers of the form `_foo` with `foo_`.
This commit is contained in:
parent
da9eb9c719
commit
37bc7c2604
|
@ -461,9 +461,9 @@ FT_BEGIN_HEADER
|
|||
* while compiling in 'release' mode):
|
||||
*
|
||||
* ```
|
||||
* _af_debug_disable_horz_hints
|
||||
* _af_debug_disable_vert_hints
|
||||
* _af_debug_disable_blue_hints
|
||||
* af_debug_disable_horz_hints_
|
||||
* af_debug_disable_vert_hints_
|
||||
* af_debug_disable_blue_hints_
|
||||
* ```
|
||||
*
|
||||
* Additionally, the following functions provide dumps of various
|
||||
|
@ -480,7 +480,7 @@ FT_BEGIN_HEADER
|
|||
* As an argument, they use another global variable:
|
||||
*
|
||||
* ```
|
||||
* _af_debug_hints
|
||||
* af_debug_hints_
|
||||
* ```
|
||||
*
|
||||
* Please have a look at the `ftgrid` demo program to see how those
|
||||
|
|
20
docs/CHANGES
20
docs/CHANGES
|
@ -53,6 +53,26 @@ CHANGES BETWEEN 2.12.1 and 2.13
|
|||
|
||||
- `ftmulti` can now handle up to 16 design axes.
|
||||
|
||||
- To avoid reserved identifiers that are globally defined, the
|
||||
auto-hinter debugging macros (which are only available if
|
||||
`FT_DEBUG_AUTOFIT` is defined)
|
||||
|
||||
```
|
||||
_af_debug_disable_horz_hints
|
||||
_af_debug_disable_vert_hints
|
||||
_af_debug_disable_blue_hints
|
||||
_af_debug_hints
|
||||
```
|
||||
|
||||
have been renamed to
|
||||
|
||||
```
|
||||
af_debug_disable_horz_hints_
|
||||
af_debug_disable_vert_hints_
|
||||
af_debug_disable_blue_hints_
|
||||
af_debug_hints_
|
||||
```
|
||||
|
||||
|
||||
======================================================================
|
||||
|
||||
|
|
|
@ -461,9 +461,9 @@ FT_BEGIN_HEADER
|
|||
* while compiling in 'release' mode):
|
||||
*
|
||||
* ```
|
||||
* _af_debug_disable_horz_hints
|
||||
* _af_debug_disable_vert_hints
|
||||
* _af_debug_disable_blue_hints
|
||||
* af_debug_disable_horz_hints_
|
||||
* af_debug_disable_vert_hints_
|
||||
* af_debug_disable_blue_hints_
|
||||
* ```
|
||||
*
|
||||
* Additionally, the following functions provide dumps of various
|
||||
|
@ -480,7 +480,7 @@ FT_BEGIN_HEADER
|
|||
* As an argument, they use another global variable:
|
||||
*
|
||||
* ```
|
||||
* _af_debug_hints
|
||||
* af_debug_hints_
|
||||
* ```
|
||||
*
|
||||
* Please have a look at the `ftgrid` demo program to see how those
|
||||
|
|
|
@ -96,15 +96,15 @@ extern "C++"
|
|||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
FT_BASE( const char* ) _ft_debug_file;
|
||||
FT_BASE( long ) _ft_debug_lineno;
|
||||
FT_BASE( const char* ) ft_debug_file_;
|
||||
FT_BASE( long ) ft_debug_lineno_;
|
||||
|
||||
#define FT_DEBUG_INNER( exp ) ( _ft_debug_file = __FILE__, \
|
||||
_ft_debug_lineno = __LINE__, \
|
||||
#define FT_DEBUG_INNER( exp ) ( ft_debug_file_ = __FILE__, \
|
||||
ft_debug_lineno_ = __LINE__, \
|
||||
(exp) )
|
||||
|
||||
#define FT_ASSIGNP_INNER( p, exp ) ( _ft_debug_file = __FILE__, \
|
||||
_ft_debug_lineno = __LINE__, \
|
||||
#define FT_ASSIGNP_INNER( p, exp ) ( ft_debug_file_ = __FILE__, \
|
||||
ft_debug_lineno_ = __LINE__, \
|
||||
FT_ASSIGNP( p, exp ) )
|
||||
|
||||
#else /* !FT_DEBUG_MEMORY */
|
||||
|
|
|
@ -356,7 +356,7 @@
|
|||
globals->scale_down_factor = 0;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
|
||||
globals->hb_font = _hb_ft_font_create( face, NULL );
|
||||
globals->hb_font = hb_ft_font_create_( face, NULL );
|
||||
globals->hb_buf = hb_buffer_create();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -375,14 +375,14 @@ FT_BEGIN_HEADER
|
|||
#ifdef FT_DEBUG_AUTOFIT
|
||||
|
||||
#define AF_HINTS_DO_HORIZONTAL( h ) \
|
||||
( !_af_debug_disable_horz_hints && \
|
||||
( !af_debug_disable_horz_hints_ && \
|
||||
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL ) )
|
||||
|
||||
#define AF_HINTS_DO_VERTICAL( h ) \
|
||||
( !_af_debug_disable_vert_hints && \
|
||||
( !af_debug_disable_vert_hints_ && \
|
||||
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_VERTICAL ) )
|
||||
|
||||
#define AF_HINTS_DO_BLUES( h ) ( !_af_debug_disable_blue_hints )
|
||||
#define AF_HINTS_DO_BLUES( h ) ( !af_debug_disable_blue_hints_ )
|
||||
|
||||
#else /* !FT_DEBUG_AUTOFIT */
|
||||
|
||||
|
|
|
@ -43,14 +43,14 @@
|
|||
|
||||
#endif
|
||||
|
||||
int _af_debug_disable_horz_hints;
|
||||
int _af_debug_disable_vert_hints;
|
||||
int _af_debug_disable_blue_hints;
|
||||
int af_debug_disable_horz_hints_;
|
||||
int af_debug_disable_vert_hints_;
|
||||
int af_debug_disable_blue_hints_;
|
||||
|
||||
/* we use a global object instead of a local one for debugging */
|
||||
static AF_GlyphHintsRec _af_debug_hints_rec[1];
|
||||
static AF_GlyphHintsRec af_debug_hints_rec_[1];
|
||||
|
||||
void* _af_debug_hints = _af_debug_hints_rec;
|
||||
void* af_debug_hints_ = af_debug_hints_rec_;
|
||||
#endif
|
||||
|
||||
#include <freetype/internal/ftobjs.h>
|
||||
|
@ -423,8 +423,8 @@
|
|||
FT_UNUSED( ft_module );
|
||||
|
||||
#ifdef FT_DEBUG_AUTOFIT
|
||||
if ( _af_debug_hints_rec->memory )
|
||||
af_glyph_hints_done( _af_debug_hints_rec );
|
||||
if ( af_debug_hints_rec_->memory )
|
||||
af_glyph_hints_done( af_debug_hints_rec_ );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -443,7 +443,7 @@
|
|||
|
||||
/* in debug mode, we use a global object that survives this routine */
|
||||
|
||||
AF_GlyphHints hints = _af_debug_hints_rec;
|
||||
AF_GlyphHints hints = af_debug_hints_rec_;
|
||||
AF_LoaderRec loader[1];
|
||||
|
||||
FT_UNUSED( size );
|
||||
|
|
|
@ -57,10 +57,10 @@ FT_BEGIN_HEADER
|
|||
|
||||
#ifdef FT_DEBUG_AUTOFIT
|
||||
|
||||
extern int _af_debug_disable_horz_hints;
|
||||
extern int _af_debug_disable_vert_hints;
|
||||
extern int _af_debug_disable_blue_hints;
|
||||
extern void* _af_debug_hints;
|
||||
extern int af_debug_disable_horz_hints_;
|
||||
extern int af_debug_disable_vert_hints_;
|
||||
extern int af_debug_disable_blue_hints_;
|
||||
extern void* af_debug_hints_;
|
||||
|
||||
#endif /* FT_DEBUG_AUTOFIT */
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
*/
|
||||
|
||||
static hb_blob_t *
|
||||
_hb_ft_reference_table (hb_face_t *face, hb_tag_t tag, void *user_data)
|
||||
hb_ft_reference_table_ (hb_face_t *face, hb_tag_t tag, void *user_data)
|
||||
{
|
||||
FT_Face ft_face = (FT_Face) user_data;
|
||||
FT_Byte *buffer;
|
||||
|
@ -68,7 +68,7 @@ _hb_ft_reference_table (hb_face_t *face, hb_tag_t tag, void *user_data)
|
|||
}
|
||||
|
||||
static hb_face_t *
|
||||
_hb_ft_face_create (FT_Face ft_face,
|
||||
hb_ft_face_create_ (FT_Face ft_face,
|
||||
hb_destroy_func_t destroy)
|
||||
{
|
||||
hb_face_t *face;
|
||||
|
@ -83,7 +83,7 @@ _hb_ft_face_create (FT_Face ft_face,
|
|||
face = hb_face_create (blob, ft_face->face_index);
|
||||
hb_blob_destroy (blob);
|
||||
} else {
|
||||
face = hb_face_create_for_tables (_hb_ft_reference_table, ft_face, destroy);
|
||||
face = hb_face_create_for_tables (hb_ft_reference_table_, ft_face, destroy);
|
||||
}
|
||||
|
||||
hb_face_set_index (face, ft_face->face_index);
|
||||
|
@ -93,13 +93,13 @@ _hb_ft_face_create (FT_Face ft_face,
|
|||
}
|
||||
|
||||
hb_font_t *
|
||||
_hb_ft_font_create (FT_Face ft_face,
|
||||
hb_ft_font_create_ (FT_Face ft_face,
|
||||
hb_destroy_func_t destroy)
|
||||
{
|
||||
hb_font_t *font;
|
||||
hb_face_t *face;
|
||||
|
||||
face = _hb_ft_face_create (ft_face, destroy);
|
||||
face = hb_ft_face_create_ (ft_face, destroy);
|
||||
font = hb_font_create (face);
|
||||
hb_face_destroy (face);
|
||||
return font;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include <hb.h>
|
||||
|
||||
hb_font_t * _hb_ft_font_create (FT_Face ft_face,
|
||||
hb_font_t * hb_ft_font_create_ (FT_Face ft_face,
|
||||
hb_destroy_func_t destroy);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
|
||||
static FT_Error
|
||||
_ft_face_scale_advances( FT_Face face,
|
||||
ft_face_scale_advances_( FT_Face face,
|
||||
FT_Fixed* advances,
|
||||
FT_UInt count,
|
||||
FT_Int32 flags )
|
||||
|
@ -96,7 +96,7 @@
|
|||
|
||||
error = func( face, gindex, 1, flags, padvance );
|
||||
if ( !error )
|
||||
return _ft_face_scale_advances( face, padvance, 1, flags );
|
||||
return ft_face_scale_advances_( face, padvance, 1, flags );
|
||||
|
||||
if ( FT_ERR_NEQ( error, Unimplemented_Feature ) )
|
||||
return error;
|
||||
|
@ -142,7 +142,7 @@
|
|||
{
|
||||
error = func( face, start, count, flags, padvances );
|
||||
if ( !error )
|
||||
return _ft_face_scale_advances( face, padvances, count, flags );
|
||||
return ft_face_scale_advances_( face, padvances, count, flags );
|
||||
|
||||
if ( FT_ERR_NEQ( error, Unimplemented_Feature ) )
|
||||
return error;
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H
|
||||
|
||||
FT_BASE_DEF( const char* ) _ft_debug_file = NULL;
|
||||
FT_BASE_DEF( long ) _ft_debug_lineno = 0;
|
||||
FT_BASE_DEF( const char* ) ft_debug_file_ = NULL;
|
||||
FT_BASE_DEF( long ) ft_debug_lineno_ = 0;
|
||||
|
||||
extern void
|
||||
FT_DumpMemory( FT_Memory memory );
|
||||
|
@ -415,8 +415,8 @@
|
|||
|
||||
/* cast to FT_PtrDist first since void* can be larger */
|
||||
/* than FT_UInt32 and GCC 4.1.1 emits a warning */
|
||||
hash = (FT_UInt32)(FT_PtrDist)(void*)_ft_debug_file +
|
||||
(FT_UInt32)( 5 * _ft_debug_lineno );
|
||||
hash = (FT_UInt32)(FT_PtrDist)(void*)ft_debug_file_ +
|
||||
(FT_UInt32)( 5 * ft_debug_lineno_ );
|
||||
pnode = &table->sources[hash % FT_MEM_SOURCE_BUCKETS];
|
||||
|
||||
for (;;)
|
||||
|
@ -425,8 +425,8 @@
|
|||
if ( !node )
|
||||
break;
|
||||
|
||||
if ( node->file_name == _ft_debug_file &&
|
||||
node->line_no == _ft_debug_lineno )
|
||||
if ( node->file_name == ft_debug_file_ &&
|
||||
node->line_no == ft_debug_lineno_ )
|
||||
goto Exit;
|
||||
|
||||
pnode = &node->link;
|
||||
|
@ -437,8 +437,8 @@
|
|||
ft_mem_debug_panic(
|
||||
"not enough memory to perform memory debugging\n" );
|
||||
|
||||
node->file_name = _ft_debug_file;
|
||||
node->line_no = _ft_debug_lineno;
|
||||
node->file_name = ft_debug_file_;
|
||||
node->line_no = ft_debug_lineno_;
|
||||
|
||||
node->cur_blocks = 0;
|
||||
node->max_blocks = 0;
|
||||
|
@ -495,7 +495,7 @@
|
|||
"org=%s:%d new=%s:%d\n",
|
||||
node->address, node->size,
|
||||
FT_FILENAME( node->source->file_name ), node->source->line_no,
|
||||
FT_FILENAME( _ft_debug_file ), _ft_debug_lineno );
|
||||
FT_FILENAME( ft_debug_file_ ), ft_debug_lineno_ );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -582,7 +582,7 @@
|
|||
" Block was allocated at (%s:%ld)\n"
|
||||
" and released at (%s:%ld).",
|
||||
address,
|
||||
FT_FILENAME( _ft_debug_file ), _ft_debug_lineno,
|
||||
FT_FILENAME( ft_debug_file_ ), ft_debug_lineno_,
|
||||
FT_FILENAME( node->source->file_name ), node->source->line_no,
|
||||
FT_FILENAME( node->free_file_name ), node->free_line_no );
|
||||
|
||||
|
@ -604,8 +604,8 @@
|
|||
/* we simply invert the node's size to indicate that the node */
|
||||
/* was freed. */
|
||||
node->size = -node->size;
|
||||
node->free_file_name = _ft_debug_file;
|
||||
node->free_line_no = _ft_debug_lineno;
|
||||
node->free_file_name = ft_debug_file_;
|
||||
node->free_line_no = ft_debug_lineno_;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -627,7 +627,7 @@
|
|||
ft_mem_debug_panic(
|
||||
"trying to free unknown block at %p in (%s:%ld)\n",
|
||||
address,
|
||||
FT_FILENAME( _ft_debug_file ), _ft_debug_lineno );
|
||||
FT_FILENAME( ft_debug_file_ ), ft_debug_lineno_ );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -661,8 +661,8 @@
|
|||
table->alloc_count++;
|
||||
}
|
||||
|
||||
_ft_debug_file = "<unknown>";
|
||||
_ft_debug_lineno = 0;
|
||||
ft_debug_file_ = "<unknown>";
|
||||
ft_debug_lineno_ = 0;
|
||||
|
||||
return (FT_Pointer)block;
|
||||
}
|
||||
|
@ -677,8 +677,8 @@
|
|||
|
||||
if ( !block )
|
||||
ft_mem_debug_panic( "trying to free NULL in (%s:%ld)",
|
||||
FT_FILENAME( _ft_debug_file ),
|
||||
_ft_debug_lineno );
|
||||
FT_FILENAME( ft_debug_file_ ),
|
||||
ft_debug_lineno_ );
|
||||
|
||||
ft_mem_table_remove( table, (FT_Byte*)block, 0 );
|
||||
|
||||
|
@ -687,8 +687,8 @@
|
|||
|
||||
table->alloc_count--;
|
||||
|
||||
_ft_debug_file = "<unknown>";
|
||||
_ft_debug_lineno = 0;
|
||||
ft_debug_file_ = "<unknown>";
|
||||
ft_debug_lineno_ = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -703,8 +703,8 @@
|
|||
FT_Pointer new_block;
|
||||
FT_Long delta;
|
||||
|
||||
const char* file_name = FT_FILENAME( _ft_debug_file );
|
||||
FT_Long line_no = _ft_debug_lineno;
|
||||
const char* file_name = FT_FILENAME( ft_debug_file_ );
|
||||
FT_Long line_no = ft_debug_lineno_;
|
||||
|
||||
|
||||
/* unlikely, but possible */
|
||||
|
@ -767,8 +767,8 @@
|
|||
|
||||
ft_mem_table_remove( table, (FT_Byte*)block, delta );
|
||||
|
||||
_ft_debug_file = "<unknown>";
|
||||
_ft_debug_lineno = 0;
|
||||
ft_debug_file_ = "<unknown>";
|
||||
ft_debug_lineno_ = 0;
|
||||
|
||||
if ( !table->keep_alive )
|
||||
ft_mem_table_free( table, block );
|
||||
|
|
|
@ -261,7 +261,7 @@
|
|||
}
|
||||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
/* assume _ft_debug_file and _ft_debug_lineno are already set */
|
||||
/* assume `ft_debug_file_` and `ft_debug_lineno_` are already set */
|
||||
stream->base = (unsigned char*)ft_mem_qalloc( memory,
|
||||
(FT_Long)count,
|
||||
&error );
|
||||
|
|
300
src/bdf/bdflib.c
300
src/bdf/bdflib.c
|
@ -58,7 +58,7 @@
|
|||
*/
|
||||
|
||||
|
||||
static const bdf_options_t _bdf_opts =
|
||||
static const bdf_options_t bdf_opts_ =
|
||||
{
|
||||
1, /* Correct metrics. */
|
||||
1, /* Preserve unencoded glyphs. */
|
||||
|
@ -76,7 +76,7 @@
|
|||
/* List of most properties that might appear in a font. Doesn't include */
|
||||
/* the RAW_* and AXIS_* properties in X11R6 polymorphic fonts. */
|
||||
|
||||
static const bdf_property_t _bdf_properties[] =
|
||||
static const bdf_property_t bdf_properties_[] =
|
||||
{
|
||||
{ "ADD_STYLE_NAME", BDF_ATOM, 1, { 0 } },
|
||||
{ "AVERAGE_WIDTH", BDF_INTEGER, 1, { 0 } },
|
||||
|
@ -164,8 +164,8 @@
|
|||
};
|
||||
|
||||
static const unsigned long
|
||||
_num_bdf_properties = sizeof ( _bdf_properties ) /
|
||||
sizeof ( _bdf_properties[0] );
|
||||
num_bdf_properties_ = sizeof ( bdf_properties_ ) /
|
||||
sizeof ( bdf_properties_[0] );
|
||||
|
||||
|
||||
/* An auxiliary macro to parse properties, to be used in conditionals. */
|
||||
|
@ -227,7 +227,7 @@
|
|||
/* Function type for parsing lines of a BDF font. */
|
||||
|
||||
typedef FT_Error
|
||||
(*_bdf_line_func_t)( char* line,
|
||||
(*bdf_line_func_t_)( char* line,
|
||||
unsigned long linelen,
|
||||
unsigned long lineno,
|
||||
void* call_data,
|
||||
|
@ -236,19 +236,19 @@
|
|||
|
||||
/* List structure for splitting lines into fields. */
|
||||
|
||||
typedef struct _bdf_list_t_
|
||||
typedef struct bdf_list_t__
|
||||
{
|
||||
char** field;
|
||||
unsigned long size;
|
||||
unsigned long used;
|
||||
FT_Memory memory;
|
||||
|
||||
} _bdf_list_t;
|
||||
} bdf_list_t_;
|
||||
|
||||
|
||||
/* Structure used while loading BDF fonts. */
|
||||
|
||||
typedef struct _bdf_parse_t_
|
||||
typedef struct bdf_parse_t__
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long cnt;
|
||||
|
@ -268,12 +268,12 @@
|
|||
bdf_font_t* font;
|
||||
bdf_options_t* opts;
|
||||
|
||||
_bdf_list_t list;
|
||||
bdf_list_t_ list;
|
||||
|
||||
FT_Memory memory;
|
||||
unsigned long size; /* the stream size */
|
||||
|
||||
} _bdf_parse_t;
|
||||
} bdf_parse_t_;
|
||||
|
||||
|
||||
#define setsbit( m, cc ) \
|
||||
|
@ -283,7 +283,7 @@
|
|||
|
||||
|
||||
static void
|
||||
_bdf_list_init( _bdf_list_t* list,
|
||||
bdf_list_init_( bdf_list_t_* list,
|
||||
FT_Memory memory )
|
||||
{
|
||||
FT_ZERO( list );
|
||||
|
@ -292,7 +292,7 @@
|
|||
|
||||
|
||||
static void
|
||||
_bdf_list_done( _bdf_list_t* list )
|
||||
bdf_list_done_( bdf_list_t_* list )
|
||||
{
|
||||
FT_Memory memory = list->memory;
|
||||
|
||||
|
@ -306,15 +306,15 @@
|
|||
|
||||
|
||||
static FT_Error
|
||||
_bdf_list_ensure( _bdf_list_t* list,
|
||||
unsigned long num_items ) /* same as _bdf_list_t.used */
|
||||
bdf_list_ensure_( bdf_list_t_* list,
|
||||
unsigned long num_items ) /* same as bdf_list_t_.used */
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
|
||||
|
||||
if ( num_items > list->size )
|
||||
{
|
||||
unsigned long oldsize = list->size; /* same as _bdf_list_t.size */
|
||||
unsigned long oldsize = list->size; /* same as bdf_list_t_.size */
|
||||
unsigned long newsize = oldsize + ( oldsize >> 1 ) + 5;
|
||||
unsigned long bigsize = (unsigned long)( FT_INT_MAX / sizeof ( char* ) );
|
||||
FT_Memory memory = list->memory;
|
||||
|
@ -340,7 +340,7 @@
|
|||
|
||||
|
||||
static void
|
||||
_bdf_list_shift( _bdf_list_t* list,
|
||||
bdf_list_shift_( bdf_list_t_* list,
|
||||
unsigned long n )
|
||||
{
|
||||
unsigned long i, u;
|
||||
|
@ -367,7 +367,7 @@
|
|||
|
||||
|
||||
static char *
|
||||
_bdf_list_join( _bdf_list_t* list,
|
||||
bdf_list_join_( bdf_list_t_* list,
|
||||
int c,
|
||||
unsigned long *alen )
|
||||
{
|
||||
|
@ -405,7 +405,7 @@
|
|||
/* don't have to check the number of fields in most cases. */
|
||||
|
||||
static FT_Error
|
||||
_bdf_list_split( _bdf_list_t* list,
|
||||
bdf_list_split_( bdf_list_t_* list,
|
||||
const char* separators,
|
||||
char* line,
|
||||
unsigned long linelen )
|
||||
|
@ -467,7 +467,7 @@
|
|||
/* Resize the list if necessary. */
|
||||
if ( list->used == list->size )
|
||||
{
|
||||
error = _bdf_list_ensure( list, list->used + 1 );
|
||||
error = bdf_list_ensure_( list, list->used + 1 );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -496,7 +496,7 @@
|
|||
/* Finally, NULL-terminate the list. */
|
||||
if ( list->used + final_empty >= list->size )
|
||||
{
|
||||
error = _bdf_list_ensure( list, list->used + final_empty + 1 );
|
||||
error = bdf_list_ensure_( list, list->used + final_empty + 1 );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -515,12 +515,12 @@
|
|||
|
||||
|
||||
static FT_Error
|
||||
_bdf_readstream( FT_Stream stream,
|
||||
_bdf_line_func_t callback,
|
||||
bdf_readstream_( FT_Stream stream,
|
||||
bdf_line_func_t_ callback,
|
||||
void* client_data,
|
||||
unsigned long *lno )
|
||||
{
|
||||
_bdf_line_func_t cb;
|
||||
bdf_line_func_t_ cb;
|
||||
unsigned long lineno, buf_size;
|
||||
int refill, hold, to_skip;
|
||||
ptrdiff_t bytes, start, end, cursor, avail;
|
||||
|
@ -603,7 +603,7 @@
|
|||
error = FT_THROW( Missing_Startfont_Field );
|
||||
else
|
||||
{
|
||||
FT_ERROR(( "_bdf_readstream: " ERRMSG6, lineno ));
|
||||
FT_ERROR(( "bdf_readstream_: " ERRMSG6, lineno ));
|
||||
error = FT_THROW( Invalid_Argument );
|
||||
}
|
||||
goto Exit;
|
||||
|
@ -702,7 +702,7 @@
|
|||
|
||||
/* Routine to convert a decimal ASCII string to an unsigned long integer. */
|
||||
static unsigned long
|
||||
_bdf_atoul( const char* s )
|
||||
bdf_atoul_( const char* s )
|
||||
{
|
||||
unsigned long v;
|
||||
|
||||
|
@ -727,7 +727,7 @@
|
|||
|
||||
/* Routine to convert a decimal ASCII string to a signed long integer. */
|
||||
static long
|
||||
_bdf_atol( const char* s )
|
||||
bdf_atol_( const char* s )
|
||||
{
|
||||
long v, neg;
|
||||
|
||||
|
@ -760,7 +760,7 @@
|
|||
|
||||
/* Routine to convert a decimal ASCII string to an unsigned short integer. */
|
||||
static unsigned short
|
||||
_bdf_atous( const char* s )
|
||||
bdf_atous_( const char* s )
|
||||
{
|
||||
unsigned short v;
|
||||
|
||||
|
@ -785,7 +785,7 @@
|
|||
|
||||
/* Routine to convert a decimal ASCII string to a signed short integer. */
|
||||
static short
|
||||
_bdf_atos( const char* s )
|
||||
bdf_atos_( const char* s )
|
||||
{
|
||||
short v, neg;
|
||||
|
||||
|
@ -874,7 +874,7 @@
|
|||
p->builtin = 0;
|
||||
p->value.atom = NULL; /* nothing is ever stored here */
|
||||
|
||||
n = _num_bdf_properties + font->nuser_props;
|
||||
n = num_bdf_properties_ + font->nuser_props;
|
||||
|
||||
error = ft_hash_str_insert( p->name, n, &(font->proptbl), memory );
|
||||
if ( error )
|
||||
|
@ -900,10 +900,10 @@
|
|||
if ( ( propid = ft_hash_str_lookup( name, &(font->proptbl) ) ) == NULL )
|
||||
return 0;
|
||||
|
||||
if ( *propid >= _num_bdf_properties )
|
||||
return font->user_props + ( *propid - _num_bdf_properties );
|
||||
if ( *propid >= num_bdf_properties_ )
|
||||
return font->user_props + ( *propid - num_bdf_properties_ );
|
||||
|
||||
return (bdf_property_t*)_bdf_properties + *propid;
|
||||
return (bdf_property_t*)bdf_properties_ + *propid;
|
||||
}
|
||||
|
||||
|
||||
|
@ -943,7 +943,7 @@
|
|||
|
||||
|
||||
static FT_Error
|
||||
_bdf_add_comment( bdf_font_t* font,
|
||||
bdf_add_comment_( bdf_font_t* font,
|
||||
char* comment,
|
||||
unsigned long len )
|
||||
{
|
||||
|
@ -972,13 +972,13 @@
|
|||
/* Set the spacing from the font name if it exists, or set it to the */
|
||||
/* default specified in the options. */
|
||||
static FT_Error
|
||||
_bdf_set_default_spacing( bdf_font_t* font,
|
||||
bdf_set_default_spacing_( bdf_font_t* font,
|
||||
bdf_options_t* opts,
|
||||
unsigned long lineno )
|
||||
{
|
||||
size_t len;
|
||||
char name[256];
|
||||
_bdf_list_t list;
|
||||
bdf_list_t_ list;
|
||||
FT_Memory memory;
|
||||
FT_Error error = FT_Err_Ok;
|
||||
|
||||
|
@ -993,7 +993,7 @@
|
|||
|
||||
memory = font->memory;
|
||||
|
||||
_bdf_list_init( &list, memory );
|
||||
bdf_list_init_( &list, memory );
|
||||
|
||||
font->spacing = opts->font_spacing;
|
||||
|
||||
|
@ -1001,14 +1001,14 @@
|
|||
/* Limit ourselves to 256 characters in the font name. */
|
||||
if ( len >= 256 )
|
||||
{
|
||||
FT_ERROR(( "_bdf_set_default_spacing: " ERRMSG7, lineno ));
|
||||
FT_ERROR(( "bdf_set_default_spacing_: " ERRMSG7, lineno ));
|
||||
error = FT_THROW( Invalid_Argument );
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
FT_MEM_COPY( name, font->name, len );
|
||||
|
||||
error = _bdf_list_split( &list, "-", name, (unsigned long)len );
|
||||
error = bdf_list_split_( &list, "-", name, (unsigned long)len );
|
||||
if ( error )
|
||||
goto Fail;
|
||||
|
||||
|
@ -1032,7 +1032,7 @@
|
|||
}
|
||||
|
||||
Fail:
|
||||
_bdf_list_done( &list );
|
||||
bdf_list_done_( &list );
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
|
@ -1042,7 +1042,7 @@
|
|||
/* Determine whether the property is an atom or not. If it is, then */
|
||||
/* clean it up so the double quotes are removed if they exist. */
|
||||
static int
|
||||
_bdf_is_atom( char* line,
|
||||
bdf_is_atom_( char* line,
|
||||
unsigned long linelen,
|
||||
char** name,
|
||||
char** value,
|
||||
|
@ -1106,7 +1106,7 @@
|
|||
|
||||
|
||||
static FT_Error
|
||||
_bdf_add_property( bdf_font_t* font,
|
||||
bdf_add_property_( bdf_font_t* font,
|
||||
const char* name,
|
||||
char* value,
|
||||
unsigned long lineno )
|
||||
|
@ -1141,11 +1141,11 @@
|
|||
break;
|
||||
|
||||
case BDF_INTEGER:
|
||||
fp->value.l = _bdf_atol( value );
|
||||
fp->value.l = bdf_atol_( value );
|
||||
break;
|
||||
|
||||
case BDF_CARDINAL:
|
||||
fp->value.ul = _bdf_atoul( value );
|
||||
fp->value.ul = bdf_atoul_( value );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1177,10 +1177,10 @@
|
|||
font->props_size++;
|
||||
}
|
||||
|
||||
if ( *propid >= _num_bdf_properties )
|
||||
prop = font->user_props + ( *propid - _num_bdf_properties );
|
||||
if ( *propid >= num_bdf_properties_ )
|
||||
prop = font->user_props + ( *propid - num_bdf_properties_ );
|
||||
else
|
||||
prop = (bdf_property_t*)_bdf_properties + *propid;
|
||||
prop = (bdf_property_t*)bdf_properties_ + *propid;
|
||||
|
||||
fp = font->props + font->props_used;
|
||||
|
||||
|
@ -1200,11 +1200,11 @@
|
|||
break;
|
||||
|
||||
case BDF_INTEGER:
|
||||
fp->value.l = _bdf_atol( value );
|
||||
fp->value.l = bdf_atol_( value );
|
||||
break;
|
||||
|
||||
case BDF_CARDINAL:
|
||||
fp->value.ul = _bdf_atoul( value );
|
||||
fp->value.ul = bdf_atoul_( value );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1238,7 +1238,7 @@
|
|||
{
|
||||
if ( !fp->value.atom )
|
||||
{
|
||||
FT_ERROR(( "_bdf_add_property: " ERRMSG8, lineno, "SPACING" ));
|
||||
FT_ERROR(( "bdf_add_property_: " ERRMSG8, lineno, "SPACING" ));
|
||||
error = FT_THROW( Invalid_File_Format );
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1263,7 +1263,7 @@
|
|||
|
||||
|
||||
static FT_Error
|
||||
_bdf_parse_end( char* line,
|
||||
bdf_parse_end_( char* line,
|
||||
unsigned long linelen,
|
||||
unsigned long lineno,
|
||||
void* call_data,
|
||||
|
@ -1283,7 +1283,7 @@
|
|||
|
||||
/* Actually parse the glyph info and bitmaps. */
|
||||
static FT_Error
|
||||
_bdf_parse_glyphs( char* line,
|
||||
bdf_parse_glyphs_( char* line,
|
||||
unsigned long linelen,
|
||||
unsigned long lineno,
|
||||
void* call_data,
|
||||
|
@ -1294,8 +1294,8 @@
|
|||
unsigned char* bp;
|
||||
unsigned long i, slen, nibbles;
|
||||
|
||||
_bdf_line_func_t* next;
|
||||
_bdf_parse_t* p;
|
||||
bdf_line_func_t_* next;
|
||||
bdf_parse_t_* p;
|
||||
bdf_glyph_t* glyph;
|
||||
bdf_font_t* font;
|
||||
|
||||
|
@ -1305,8 +1305,8 @@
|
|||
FT_UNUSED( lineno ); /* only used in debug mode */
|
||||
|
||||
|
||||
next = (_bdf_line_func_t *)call_data;
|
||||
p = (_bdf_parse_t *) client_data;
|
||||
next = (bdf_line_func_t_ *)call_data;
|
||||
p = (bdf_parse_t_ *) client_data;
|
||||
|
||||
font = p->font;
|
||||
memory = font->memory;
|
||||
|
@ -1324,7 +1324,7 @@
|
|||
s++;
|
||||
linelen--;
|
||||
}
|
||||
error = _bdf_add_comment( p->font, s, linelen );
|
||||
error = bdf_add_comment_( p->font, s, linelen );
|
||||
}
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1334,21 +1334,21 @@
|
|||
{
|
||||
if ( _bdf_strncmp( line, "CHARS", 5 ) != 0 )
|
||||
{
|
||||
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "CHARS" ));
|
||||
FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG1, lineno, "CHARS" ));
|
||||
error = FT_THROW( Missing_Chars_Field );
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
error = _bdf_list_split( &p->list, " +", line, linelen );
|
||||
error = bdf_list_split_( &p->list, " +", line, linelen );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
p->cnt = font->glyphs_size = _bdf_atoul( p->list.field[1] );
|
||||
p->cnt = font->glyphs_size = bdf_atoul_( p->list.field[1] );
|
||||
|
||||
/* We need at least 20 bytes per glyph. */
|
||||
if ( p->cnt > p->size / 20 )
|
||||
{
|
||||
p->cnt = font->glyphs_size = p->size / 20;
|
||||
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG17, p->cnt ));
|
||||
FT_TRACE2(( "bdf_parse_glyphs_: " ACMSG17, p->cnt ));
|
||||
}
|
||||
|
||||
/* Make sure the number of glyphs is non-zero. */
|
||||
|
@ -1359,7 +1359,7 @@
|
|||
/* number of code points available in Unicode). */
|
||||
if ( p->cnt >= 0x110000UL )
|
||||
{
|
||||
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG5, lineno, "CHARS" ));
|
||||
FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG5, lineno, "CHARS" ));
|
||||
error = FT_THROW( Invalid_Argument );
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1378,7 +1378,7 @@
|
|||
if ( p->flags & BDF_GLYPH_BITS_ )
|
||||
{
|
||||
/* Missing ENDCHAR field. */
|
||||
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENDCHAR" ));
|
||||
FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG1, lineno, "ENDCHAR" ));
|
||||
error = FT_THROW( Corrupted_Font_Glyphs );
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1390,7 +1390,7 @@
|
|||
by_encoding );
|
||||
|
||||
p->flags &= ~BDF_START_;
|
||||
*next = _bdf_parse_end;
|
||||
*next = bdf_parse_end_;
|
||||
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1417,7 +1417,7 @@
|
|||
if ( p->flags & BDF_GLYPH_BITS_ )
|
||||
{
|
||||
/* Missing ENDCHAR field. */
|
||||
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENDCHAR" ));
|
||||
FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG1, lineno, "ENDCHAR" ));
|
||||
error = FT_THROW( Missing_Startchar_Field );
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1426,17 +1426,17 @@
|
|||
/* encoding can be checked for an unencoded character. */
|
||||
FT_FREE( p->glyph_name );
|
||||
|
||||
error = _bdf_list_split( &p->list, " +", line, linelen );
|
||||
error = bdf_list_split_( &p->list, " +", line, linelen );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
_bdf_list_shift( &p->list, 1 );
|
||||
bdf_list_shift_( &p->list, 1 );
|
||||
|
||||
s = _bdf_list_join( &p->list, ' ', &slen );
|
||||
s = bdf_list_join_( &p->list, ' ', &slen );
|
||||
|
||||
if ( !s )
|
||||
{
|
||||
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG8, lineno, "STARTCHAR" ));
|
||||
FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG8, lineno, "STARTCHAR" ));
|
||||
error = FT_THROW( Invalid_File_Format );
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1459,16 +1459,16 @@
|
|||
if ( !( p->flags & BDF_GLYPH_ ) )
|
||||
{
|
||||
/* Missing STARTCHAR field. */
|
||||
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "STARTCHAR" ));
|
||||
FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG1, lineno, "STARTCHAR" ));
|
||||
error = FT_THROW( Missing_Startchar_Field );
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
error = _bdf_list_split( &p->list, " +", line, linelen );
|
||||
error = bdf_list_split_( &p->list, " +", line, linelen );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
p->glyph_enc = _bdf_atol( p->list.field[1] );
|
||||
p->glyph_enc = bdf_atol_( p->list.field[1] );
|
||||
|
||||
/* Normalize negative encoding values. The specification only */
|
||||
/* allows -1, but we can be more generous here. */
|
||||
|
@ -1477,7 +1477,7 @@
|
|||
|
||||
/* Check for alternative encoding format. */
|
||||
if ( p->glyph_enc == -1 && p->list.used > 2 )
|
||||
p->glyph_enc = _bdf_atol( p->list.field[2] );
|
||||
p->glyph_enc = bdf_atol_( p->list.field[2] );
|
||||
|
||||
if ( p->glyph_enc < -1 || p->glyph_enc >= 0x110000L )
|
||||
p->glyph_enc = -1;
|
||||
|
@ -1564,7 +1564,7 @@
|
|||
{
|
||||
if ( !( p->flags & BDF_GLYPH_HEIGHT_CHECK_ ) )
|
||||
{
|
||||
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG13, glyph->encoding ));
|
||||
FT_TRACE2(( "bdf_parse_glyphs_: " ACMSG13, glyph->encoding ));
|
||||
p->flags |= BDF_GLYPH_HEIGHT_CHECK_;
|
||||
}
|
||||
|
||||
|
@ -1591,7 +1591,7 @@
|
|||
if ( i < nibbles &&
|
||||
!( p->flags & BDF_GLYPH_WIDTH_CHECK_ ) )
|
||||
{
|
||||
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG16, glyph->encoding ));
|
||||
FT_TRACE2(( "bdf_parse_glyphs_: " ACMSG16, glyph->encoding ));
|
||||
p->flags |= BDF_GLYPH_WIDTH_CHECK_;
|
||||
}
|
||||
|
||||
|
@ -1605,7 +1605,7 @@
|
|||
sbitset( hdigits, line[nibbles] ) &&
|
||||
!( p->flags & BDF_GLYPH_WIDTH_CHECK_ ) )
|
||||
{
|
||||
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG14, glyph->encoding ));
|
||||
FT_TRACE2(( "bdf_parse_glyphs_: " ACMSG14, glyph->encoding ));
|
||||
p->flags |= BDF_GLYPH_WIDTH_CHECK_;
|
||||
}
|
||||
|
||||
|
@ -1616,11 +1616,11 @@
|
|||
/* Expect the SWIDTH (scalable width) field next. */
|
||||
if ( _bdf_strncmp( line, "SWIDTH", 6 ) == 0 )
|
||||
{
|
||||
error = _bdf_list_split( &p->list, " +", line, linelen );
|
||||
error = bdf_list_split_( &p->list, " +", line, linelen );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
glyph->swidth = _bdf_atous( p->list.field[1] );
|
||||
glyph->swidth = bdf_atous_( p->list.field[1] );
|
||||
p->flags |= BDF_SWIDTH_;
|
||||
|
||||
goto Exit;
|
||||
|
@ -1629,17 +1629,17 @@
|
|||
/* Expect the DWIDTH (device width) field next. */
|
||||
if ( _bdf_strncmp( line, "DWIDTH", 6 ) == 0 )
|
||||
{
|
||||
error = _bdf_list_split( &p->list, " +", line, linelen );
|
||||
error = bdf_list_split_( &p->list, " +", line, linelen );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
glyph->dwidth = _bdf_atous( p->list.field[1] );
|
||||
glyph->dwidth = bdf_atous_( p->list.field[1] );
|
||||
|
||||
if ( !( p->flags & BDF_SWIDTH_ ) )
|
||||
{
|
||||
/* Missing SWIDTH field. Emit an auto correction message and set */
|
||||
/* the scalable width from the device width. */
|
||||
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG9, lineno ));
|
||||
FT_TRACE2(( "bdf_parse_glyphs_: " ACMSG9, lineno ));
|
||||
|
||||
glyph->swidth = (unsigned short)FT_MulDiv(
|
||||
glyph->dwidth, 72000L,
|
||||
|
@ -1654,14 +1654,14 @@
|
|||
/* Expect the BBX field next. */
|
||||
if ( _bdf_strncmp( line, "BBX", 3 ) == 0 )
|
||||
{
|
||||
error = _bdf_list_split( &p->list, " +", line, linelen );
|
||||
error = bdf_list_split_( &p->list, " +", line, linelen );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
glyph->bbx.width = _bdf_atous( p->list.field[1] );
|
||||
glyph->bbx.height = _bdf_atous( p->list.field[2] );
|
||||
glyph->bbx.x_offset = _bdf_atos( p->list.field[3] );
|
||||
glyph->bbx.y_offset = _bdf_atos( p->list.field[4] );
|
||||
glyph->bbx.width = bdf_atous_( p->list.field[1] );
|
||||
glyph->bbx.height = bdf_atous_( p->list.field[2] );
|
||||
glyph->bbx.x_offset = bdf_atos_( p->list.field[3] );
|
||||
glyph->bbx.y_offset = bdf_atos_( p->list.field[4] );
|
||||
|
||||
/* Generate the ascent and descent of the character. */
|
||||
glyph->bbx.ascent = (short)( glyph->bbx.height + glyph->bbx.y_offset );
|
||||
|
@ -1682,7 +1682,7 @@
|
|||
{
|
||||
/* Missing DWIDTH field. Emit an auto correction message and set */
|
||||
/* the device width to the glyph width. */
|
||||
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG10, lineno ));
|
||||
FT_TRACE2(( "bdf_parse_glyphs_: " ACMSG10, lineno ));
|
||||
glyph->dwidth = glyph->bbx.width;
|
||||
}
|
||||
|
||||
|
@ -1718,7 +1718,7 @@
|
|||
if ( !( p->flags & BDF_BBX_ ) )
|
||||
{
|
||||
/* Missing BBX field. */
|
||||
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "BBX" ));
|
||||
FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG1, lineno, "BBX" ));
|
||||
error = FT_THROW( Missing_Bbx_Field );
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1729,7 +1729,7 @@
|
|||
bitmap_size = glyph->bpr * glyph->bbx.height;
|
||||
if ( glyph->bpr > 0xFFFFU || bitmap_size > 0xFFFFU )
|
||||
{
|
||||
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG4, lineno ));
|
||||
FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG4, lineno ));
|
||||
error = FT_THROW( Bbx_Too_Big );
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1745,13 +1745,13 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG9, lineno ));
|
||||
FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG9, lineno ));
|
||||
error = FT_THROW( Invalid_File_Format );
|
||||
goto Exit;
|
||||
|
||||
Missing_Encoding:
|
||||
/* Missing ENCODING field. */
|
||||
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENCODING" ));
|
||||
FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG1, lineno, "ENCODING" ));
|
||||
error = FT_THROW( Missing_Encoding_Field );
|
||||
|
||||
Exit:
|
||||
|
@ -1764,15 +1764,15 @@
|
|||
|
||||
/* Load the font properties. */
|
||||
static FT_Error
|
||||
_bdf_parse_properties( char* line,
|
||||
bdf_parse_properties_( char* line,
|
||||
unsigned long linelen,
|
||||
unsigned long lineno,
|
||||
void* call_data,
|
||||
void* client_data )
|
||||
{
|
||||
unsigned long vlen;
|
||||
_bdf_line_func_t* next;
|
||||
_bdf_parse_t* p;
|
||||
bdf_line_func_t_* next;
|
||||
bdf_parse_t_* p;
|
||||
char* name;
|
||||
char* value;
|
||||
char nbuf[128];
|
||||
|
@ -1781,8 +1781,8 @@
|
|||
FT_UNUSED( lineno );
|
||||
|
||||
|
||||
next = (_bdf_line_func_t *)call_data;
|
||||
p = (_bdf_parse_t *) client_data;
|
||||
next = (bdf_line_func_t_ *)call_data;
|
||||
p = (bdf_parse_t_ *) client_data;
|
||||
|
||||
/* Check for the end of the properties. */
|
||||
if ( _bdf_strncmp( line, "ENDPROPERTIES", 13 ) == 0 )
|
||||
|
@ -1797,28 +1797,28 @@
|
|||
{
|
||||
p->font->font_ascent = p->font->bbx.ascent;
|
||||
ft_sprintf( nbuf, "%hd", p->font->bbx.ascent );
|
||||
error = _bdf_add_property( p->font, "FONT_ASCENT",
|
||||
error = bdf_add_property_( p->font, "FONT_ASCENT",
|
||||
nbuf, lineno );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE2(( "_bdf_parse_properties: " ACMSG1, p->font->bbx.ascent ));
|
||||
FT_TRACE2(( "bdf_parse_properties_: " ACMSG1, p->font->bbx.ascent ));
|
||||
}
|
||||
|
||||
if ( bdf_get_font_property( p->font, "FONT_DESCENT" ) == 0 )
|
||||
{
|
||||
p->font->font_descent = p->font->bbx.descent;
|
||||
ft_sprintf( nbuf, "%hd", p->font->bbx.descent );
|
||||
error = _bdf_add_property( p->font, "FONT_DESCENT",
|
||||
error = bdf_add_property_( p->font, "FONT_DESCENT",
|
||||
nbuf, lineno );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE2(( "_bdf_parse_properties: " ACMSG2, p->font->bbx.descent ));
|
||||
FT_TRACE2(( "bdf_parse_properties_: " ACMSG2, p->font->bbx.descent ));
|
||||
}
|
||||
|
||||
p->flags &= ~BDF_PROPS_;
|
||||
*next = _bdf_parse_glyphs;
|
||||
*next = bdf_parse_glyphs_;
|
||||
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1835,27 +1835,27 @@
|
|||
value += 7;
|
||||
if ( *value )
|
||||
*value++ = 0;
|
||||
error = _bdf_add_property( p->font, name, value, lineno );
|
||||
error = bdf_add_property_( p->font, name, value, lineno );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
else if ( _bdf_is_atom( line, linelen, &name, &value, p->font ) )
|
||||
else if ( bdf_is_atom_( line, linelen, &name, &value, p->font ) )
|
||||
{
|
||||
error = _bdf_add_property( p->font, name, value, lineno );
|
||||
error = bdf_add_property_( p->font, name, value, lineno );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = _bdf_list_split( &p->list, " +", line, linelen );
|
||||
error = bdf_list_split_( &p->list, " +", line, linelen );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
name = p->list.field[0];
|
||||
|
||||
_bdf_list_shift( &p->list, 1 );
|
||||
value = _bdf_list_join( &p->list, ' ', &vlen );
|
||||
bdf_list_shift_( &p->list, 1 );
|
||||
value = bdf_list_join_( &p->list, ' ', &vlen );
|
||||
|
||||
error = _bdf_add_property( p->font, name, value, lineno );
|
||||
error = bdf_add_property_( p->font, name, value, lineno );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1867,15 +1867,15 @@
|
|||
|
||||
/* Load the font header. */
|
||||
static FT_Error
|
||||
_bdf_parse_start( char* line,
|
||||
bdf_parse_start_( char* line,
|
||||
unsigned long linelen,
|
||||
unsigned long lineno,
|
||||
void* call_data,
|
||||
void* client_data )
|
||||
{
|
||||
unsigned long slen;
|
||||
_bdf_line_func_t* next;
|
||||
_bdf_parse_t* p;
|
||||
bdf_line_func_t_* next;
|
||||
bdf_parse_t_* p;
|
||||
bdf_font_t* font;
|
||||
char *s;
|
||||
|
||||
|
@ -1885,8 +1885,8 @@
|
|||
FT_UNUSED( lineno ); /* only used in debug mode */
|
||||
|
||||
|
||||
next = (_bdf_line_func_t *)call_data;
|
||||
p = (_bdf_parse_t *) client_data;
|
||||
next = (bdf_line_func_t_ *)call_data;
|
||||
p = (bdf_parse_t_ *) client_data;
|
||||
|
||||
if ( p->font )
|
||||
memory = p->font->memory;
|
||||
|
@ -1905,7 +1905,7 @@
|
|||
s++;
|
||||
linelen--;
|
||||
}
|
||||
error = _bdf_add_comment( p->font, s, linelen );
|
||||
error = bdf_add_comment_( p->font, s, linelen );
|
||||
}
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1939,8 +1939,8 @@
|
|||
error = ft_hash_str_init( &(font->proptbl), memory );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
for ( i = 0, prop = (bdf_property_t*)_bdf_properties;
|
||||
i < _num_bdf_properties; i++, prop++ )
|
||||
for ( i = 0, prop = (bdf_property_t*)bdf_properties_;
|
||||
i < num_bdf_properties_; i++, prop++ )
|
||||
{
|
||||
error = ft_hash_str_insert( prop->name, i,
|
||||
&(font->proptbl), memory );
|
||||
|
@ -1966,23 +1966,23 @@
|
|||
if ( !( p->flags & BDF_FONT_BBX_ ) )
|
||||
{
|
||||
/* Missing the FONTBOUNDINGBOX field. */
|
||||
FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONTBOUNDINGBOX" ));
|
||||
FT_ERROR(( "bdf_parse_start_: " ERRMSG1, lineno, "FONTBOUNDINGBOX" ));
|
||||
error = FT_THROW( Missing_Fontboundingbox_Field );
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
error = _bdf_list_split( &p->list, " +", line, linelen );
|
||||
error = bdf_list_split_( &p->list, " +", line, linelen );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
/* at this point, `p->font' can't be NULL */
|
||||
p->cnt = p->font->props_size = _bdf_atoul( p->list.field[1] );
|
||||
p->cnt = p->font->props_size = bdf_atoul_( p->list.field[1] );
|
||||
/* We need at least 4 bytes per property. */
|
||||
if ( p->cnt > p->size / 4 )
|
||||
{
|
||||
p->font->props_size = 0;
|
||||
|
||||
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG5, lineno, "STARTPROPERTIES" ));
|
||||
FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG5, lineno, "STARTPROPERTIES" ));
|
||||
error = FT_THROW( Invalid_Argument );
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1994,7 +1994,7 @@
|
|||
}
|
||||
|
||||
p->flags |= BDF_PROPS_;
|
||||
*next = _bdf_parse_properties;
|
||||
*next = bdf_parse_properties_;
|
||||
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -2005,20 +2005,20 @@
|
|||
if ( !( p->flags & BDF_SIZE_ ) )
|
||||
{
|
||||
/* Missing the SIZE field. */
|
||||
FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "SIZE" ));
|
||||
FT_ERROR(( "bdf_parse_start_: " ERRMSG1, lineno, "SIZE" ));
|
||||
error = FT_THROW( Missing_Size_Field );
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
error = _bdf_list_split( &p->list, " +", line, linelen );
|
||||
error = bdf_list_split_( &p->list, " +", line, linelen );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
p->font->bbx.width = _bdf_atous( p->list.field[1] );
|
||||
p->font->bbx.height = _bdf_atous( p->list.field[2] );
|
||||
p->font->bbx.width = bdf_atous_( p->list.field[1] );
|
||||
p->font->bbx.height = bdf_atous_( p->list.field[2] );
|
||||
|
||||
p->font->bbx.x_offset = _bdf_atos( p->list.field[3] );
|
||||
p->font->bbx.y_offset = _bdf_atos( p->list.field[4] );
|
||||
p->font->bbx.x_offset = bdf_atos_( p->list.field[3] );
|
||||
p->font->bbx.y_offset = bdf_atos_( p->list.field[4] );
|
||||
|
||||
p->font->bbx.ascent = (short)( p->font->bbx.height +
|
||||
p->font->bbx.y_offset );
|
||||
|
@ -2033,16 +2033,16 @@
|
|||
/* The next thing to check for is the FONT field. */
|
||||
if ( _bdf_strncmp( line, "FONT", 4 ) == 0 )
|
||||
{
|
||||
error = _bdf_list_split( &p->list, " +", line, linelen );
|
||||
error = bdf_list_split_( &p->list, " +", line, linelen );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
_bdf_list_shift( &p->list, 1 );
|
||||
bdf_list_shift_( &p->list, 1 );
|
||||
|
||||
s = _bdf_list_join( &p->list, ' ', &slen );
|
||||
s = bdf_list_join_( &p->list, ' ', &slen );
|
||||
|
||||
if ( !s )
|
||||
{
|
||||
FT_ERROR(( "_bdf_parse_start: " ERRMSG8, lineno, "FONT" ));
|
||||
FT_ERROR(( "bdf_parse_start_: " ERRMSG8, lineno, "FONT" ));
|
||||
error = FT_THROW( Invalid_File_Format );
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -2056,7 +2056,7 @@
|
|||
|
||||
/* If the font name is an XLFD name, set the spacing to the one in */
|
||||
/* the font name. If there is no spacing fall back on the default. */
|
||||
error = _bdf_set_default_spacing( p->font, p->opts, lineno );
|
||||
error = bdf_set_default_spacing_( p->font, p->opts, lineno );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
|
@ -2071,18 +2071,18 @@
|
|||
if ( !( p->flags & BDF_FONT_NAME_ ) )
|
||||
{
|
||||
/* Missing the FONT field. */
|
||||
FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONT" ));
|
||||
FT_ERROR(( "bdf_parse_start_: " ERRMSG1, lineno, "FONT" ));
|
||||
error = FT_THROW( Missing_Font_Field );
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
error = _bdf_list_split( &p->list, " +", line, linelen );
|
||||
error = bdf_list_split_( &p->list, " +", line, linelen );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
p->font->point_size = _bdf_atoul( p->list.field[1] );
|
||||
p->font->resolution_x = _bdf_atoul( p->list.field[2] );
|
||||
p->font->resolution_y = _bdf_atoul( p->list.field[3] );
|
||||
p->font->point_size = bdf_atoul_( p->list.field[1] );
|
||||
p->font->resolution_x = bdf_atoul_( p->list.field[2] );
|
||||
p->font->resolution_y = bdf_atoul_( p->list.field[3] );
|
||||
|
||||
/* Check for the bits per pixel field. */
|
||||
if ( p->list.used == 5 )
|
||||
|
@ -2090,7 +2090,7 @@
|
|||
unsigned short bpp;
|
||||
|
||||
|
||||
bpp = _bdf_atous( p->list.field[4] );
|
||||
bpp = bdf_atous_( p->list.field[4] );
|
||||
|
||||
/* Only values 1, 2, 4, 8 are allowed for greymap fonts. */
|
||||
if ( bpp > 4 )
|
||||
|
@ -2103,7 +2103,7 @@
|
|||
p->font->bpp = 1;
|
||||
|
||||
if ( p->font->bpp != bpp )
|
||||
FT_TRACE2(( "_bdf_parse_start: " ACMSG11, p->font->bpp ));
|
||||
FT_TRACE2(( "bdf_parse_start_: " ACMSG11, p->font->bpp ));
|
||||
}
|
||||
else
|
||||
p->font->bpp = 1;
|
||||
|
@ -2122,7 +2122,7 @@
|
|||
if ( !( p->flags & BDF_FONT_BBX_ ) )
|
||||
{
|
||||
/* Missing the FONTBOUNDINGBOX field. */
|
||||
FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONTBOUNDINGBOX" ));
|
||||
FT_ERROR(( "bdf_parse_start_: " ERRMSG1, lineno, "FONTBOUNDINGBOX" ));
|
||||
error = FT_THROW( Missing_Fontboundingbox_Field );
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -2131,28 +2131,28 @@
|
|||
/* for compiling fonts. */
|
||||
p->font->font_ascent = p->font->bbx.ascent;
|
||||
ft_sprintf( nbuf, "%hd", p->font->bbx.ascent );
|
||||
error = _bdf_add_property( p->font, "FONT_ASCENT",
|
||||
error = bdf_add_property_( p->font, "FONT_ASCENT",
|
||||
nbuf, lineno );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
FT_TRACE2(( "_bdf_parse_properties: " ACMSG1, p->font->bbx.ascent ));
|
||||
FT_TRACE2(( "bdf_parse_properties_: " ACMSG1, p->font->bbx.ascent ));
|
||||
|
||||
p->font->font_descent = p->font->bbx.descent;
|
||||
ft_sprintf( nbuf, "%hd", p->font->bbx.descent );
|
||||
error = _bdf_add_property( p->font, "FONT_DESCENT",
|
||||
error = bdf_add_property_( p->font, "FONT_DESCENT",
|
||||
nbuf, lineno );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
FT_TRACE2(( "_bdf_parse_properties: " ACMSG2, p->font->bbx.descent ));
|
||||
FT_TRACE2(( "bdf_parse_properties_: " ACMSG2, p->font->bbx.descent ));
|
||||
|
||||
*next = _bdf_parse_glyphs;
|
||||
*next = bdf_parse_glyphs_;
|
||||
|
||||
/* A special return value. */
|
||||
error = -1;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
FT_ERROR(( "_bdf_parse_start: " ERRMSG9, lineno ));
|
||||
FT_ERROR(( "bdf_parse_start_: " ERRMSG9, lineno ));
|
||||
error = FT_THROW( Invalid_File_Format );
|
||||
|
||||
Exit:
|
||||
|
@ -2174,7 +2174,7 @@
|
|||
bdf_font_t* *font )
|
||||
{
|
||||
unsigned long lineno = 0; /* make compiler happy */
|
||||
_bdf_parse_t *p = NULL;
|
||||
bdf_parse_t_ *p = NULL;
|
||||
|
||||
FT_Error error = FT_Err_Ok;
|
||||
|
||||
|
@ -2182,14 +2182,14 @@
|
|||
if ( FT_NEW( p ) )
|
||||
goto Exit;
|
||||
|
||||
p->opts = (bdf_options_t*)( opts ? opts : &_bdf_opts );
|
||||
p->opts = (bdf_options_t*)( opts ? opts : &bdf_opts_ );
|
||||
p->minlb = 32767;
|
||||
p->size = stream->size;
|
||||
p->memory = memory; /* only during font creation */
|
||||
|
||||
_bdf_list_init( &p->list, memory );
|
||||
bdf_list_init_( &p->list, memory );
|
||||
|
||||
error = _bdf_readstream( stream, _bdf_parse_start,
|
||||
error = bdf_readstream_( stream, bdf_parse_start_,
|
||||
(void *)p, &lineno );
|
||||
if ( error )
|
||||
goto Fail;
|
||||
|
@ -2283,7 +2283,7 @@
|
|||
Exit:
|
||||
if ( p )
|
||||
{
|
||||
_bdf_list_done( &p->list );
|
||||
bdf_list_done_( &p->list );
|
||||
|
||||
FT_FREE( p->glyph_name );
|
||||
FT_FREE( p );
|
||||
|
|
|
@ -6871,7 +6871,7 @@
|
|||
|
||||
|
||||
static void
|
||||
_iup_worker_shift( IUP_Worker worker,
|
||||
iup_worker_shift_( IUP_Worker worker,
|
||||
FT_UInt p1,
|
||||
FT_UInt p2,
|
||||
FT_UInt p )
|
||||
|
@ -6893,7 +6893,7 @@
|
|||
|
||||
|
||||
static void
|
||||
_iup_worker_interpolate( IUP_Worker worker,
|
||||
iup_worker_interpolate_( IUP_Worker worker,
|
||||
FT_UInt p1,
|
||||
FT_UInt p2,
|
||||
FT_UInt ref1,
|
||||
|
@ -7087,7 +7087,7 @@
|
|||
{
|
||||
if ( ( exc->pts.tags[point] & mask ) != 0 )
|
||||
{
|
||||
_iup_worker_interpolate( &V,
|
||||
iup_worker_interpolate_( &V,
|
||||
cur_touched + 1,
|
||||
point - 1,
|
||||
cur_touched,
|
||||
|
@ -7099,17 +7099,17 @@
|
|||
}
|
||||
|
||||
if ( cur_touched == first_touched )
|
||||
_iup_worker_shift( &V, first_point, end_point, cur_touched );
|
||||
iup_worker_shift_( &V, first_point, end_point, cur_touched );
|
||||
else
|
||||
{
|
||||
_iup_worker_interpolate( &V,
|
||||
iup_worker_interpolate_( &V,
|
||||
(FT_UShort)( cur_touched + 1 ),
|
||||
end_point,
|
||||
cur_touched,
|
||||
first_touched );
|
||||
|
||||
if ( first_touched > 0 )
|
||||
_iup_worker_interpolate( &V,
|
||||
iup_worker_interpolate_( &V,
|
||||
first_point,
|
||||
first_touched - 1,
|
||||
cur_touched,
|
||||
|
|
Loading…
Reference in New Issue