ref: c8f9cf37d3315522ce8799ccc10c0c5fc8cf091d
parent: 0959a8777a2b7fedcb95221338eb1dc408e64c40
author: Werner Lemberg <[email protected]>
date: Tue Jul 18 22:59:31 EDT 2000
Formatting.
--- a/include/freetype/internal/ftstream.h
+++ b/include/freetype/internal/ftstream.h
@@ -1,3 +1,21 @@
+/***************************************************************************/
+/* */
+/* ftstream.h */
+/* */
+/* Stream handling(specification). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
#ifndef FTSTREAM_H
#define FTSTREAM_H
@@ -9,292 +27,312 @@
#endif
-/* format of an 8-bit frame_op value = [ xxxxx | e | s ] */
-/* where s is set to 1 when the value is signed.. */
-/* where e is set to 1 when the value is little-endian */
-/* xxxxx is a command */
+ /* format of an 8-bit frame_op value = [ xxxxx | e | s ] */
+ /* s is set to 1 if the value is signed, */
+ /* e is set to 1 if the value is little-endian */
+ /* xxxxx is a command */
-#define FT_FRAME_OP_SHIFT 2
-#define FT_FRAME_OP_SIGNED 1
-#define FT_FRAME_OP_LITTLE 2
-#define FT_FRAME_OP_COMMAND(x) (x >> FT_FRAME_OP_SHIFT)
+#define FT_FRAME_OP_SHIFT 2
+#define FT_FRAME_OP_SIGNED 1
+#define FT_FRAME_OP_LITTLE 2
+#define FT_FRAME_OP_COMMAND( x ) ( x >> FT_FRAME_OP_SHIFT )
-#define FT_MAKE_FRAME_OP( command, little, sign ) \
- ((command << FT_FRAME_OP_SHIFT) | (little << 1) | sign)
+#define FT_MAKE_FRAME_OP( command, little, sign ) \
+ ( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )
#define FT_FRAME_OP_END 0
-#define FT_FRAME_OP_START 1 /* start a new frame */
-#define FT_FRAME_OP_BYTE 2 /* read 1-byte value */
-#define FT_FRAME_OP_SHORT 3 /* read 2-byte value */
-#define FT_FRAME_OP_LONG 4 /* read 4-byte value */
-#define FT_FRAME_OP_OFF3 5 /* read 3-byte value */
+#define FT_FRAME_OP_START 1 /* start a new frame */
+#define FT_FRAME_OP_BYTE 2 /* read 1-byte value */
+#define FT_FRAME_OP_SHORT 3 /* read 2-byte value */
+#define FT_FRAME_OP_LONG 4 /* read 4-byte value */
+#define FT_FRAME_OP_OFF3 5 /* read 3-byte value */
#define FT_FRAME_OP_BYTES 6 /* read a bytes sequence */
-typedef enum FT_Frame_Op_
-{
- ft_frame_end = 0,
- ft_frame_start = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),
- ft_frame_byte = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 0 ),
- ft_frame_schar = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 1 ),
+ typedef enum FT_Frame_Op_
+ {
+ ft_frame_end = 0,
+ ft_frame_start = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),
- ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),
- ft_frame_short_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),
- ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),
- ft_frame_short_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),
+ ft_frame_byte = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 0 ),
+ ft_frame_schar = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 1 ),
- ft_frame_ulong_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),
- ft_frame_ulong_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),
- ft_frame_long_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),
- ft_frame_long_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),
+ ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),
+ ft_frame_short_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),
+ ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),
+ ft_frame_short_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),
- ft_frame_uoff3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),
- ft_frame_uoff3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),
- ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),
- ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),
+ ft_frame_ulong_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),
+ ft_frame_ulong_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),
+ ft_frame_long_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),
+ ft_frame_long_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),
+
+ ft_frame_uoff3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),
+ ft_frame_uoff3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),
+ ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),
+ ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),
- ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),
- ft_frame_skip = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )
+ ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),
+ ft_frame_skip = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )
-} FT_Frame_Op;
+ } FT_Frame_Op;
-typedef struct FT_Frame_Field_
-{
- FT_Frame_Op value;
- char size;
- FT_UShort offset;
+ typedef struct FT_Frame_Field_
+ {
+ FT_Frame_Op value;
+ char size;
+ FT_UShort offset;
-} FT_Frame_Field;
+ } FT_Frame_Field;
-/* make-up a FT_Frame_Field out of a structure type and a field name */
-#define FT_FIELD_REF(s,f) (((s*)0)->f)
-#define FT_FRAME_FIELD( frame_op, struct_type, field ) \
- { \
- frame_op, \
- sizeof(FT_FIELD_REF(struct_type,field)), \
- (FT_UShort)(char*)&FT_FIELD_REF(struct_type,field) }
+ /* make-up a FT_Frame_Field out of a structure type and a field name */
+#define FT_FIELD_REF( s, f ) (((s*)0)->f)
+#define FT_FRAME_FIELD( frame_op, struct_type, field ) \
+ { \
+ frame_op, \
+ sizeof ( FT_FIELD_REF( struct_type,field ) ), \
+ (FT_UShort)(char*)&FT_FIELD_REF( struct_type, field ) \
+ }
+
#define FT_MAKE_EMPTY_FIELD( frame_op ) { frame_op, 0, 0 }
-#define FT_FRAME_START(s) { ft_frame_start, 0, s }
-#define FT_FRAME_END { ft_frame_end, 0, 0 }
+#define FT_FRAME_START( s ) { ft_frame_start, 0, s }
+#define FT_FRAME_END { ft_frame_end, 0, 0 }
-#define FT_FRAME_LONG(s,f) FT_FRAME_FIELD( ft_frame_long_be, s, f )
-#define FT_FRAME_ULONG(s,f) FT_FRAME_FIELD( ft_frame_ulong_be, s, f )
-#define FT_FRAME_SHORT(s,f) FT_FRAME_FIELD( ft_frame_short_be, s, f )
-#define FT_FRAME_USHORT(s,f) FT_FRAME_FIELD( ft_frame_ushort_be, s, f )
-#define FT_FRAME_BYTE(s,f) FT_FRAME_FIELD( ft_frame_byte, s, f )
-#define FT_FRAME_CHAR(s,f) FT_FRAME_FIELD( ft_frame_schar, s, f )
+#define FT_FRAME_LONG( s, f ) FT_FRAME_FIELD( ft_frame_long_be, s, f )
+#define FT_FRAME_ULONG( s, f ) FT_FRAME_FIELD( ft_frame_ulong_be, s, f )
+#define FT_FRAME_SHORT( s, f ) FT_FRAME_FIELD( ft_frame_short_be, s, f )
+#define FT_FRAME_USHORT( s, f ) FT_FRAME_FIELD( ft_frame_ushort_be, s, f )
+#define FT_FRAME_BYTE( s, f ) FT_FRAME_FIELD( ft_frame_byte, s, f )
+#define FT_FRAME_CHAR( s, f ) FT_FRAME_FIELD( ft_frame_schar, s, f )
-#define FT_FRAME_LONG_LE(s,f) FT_FRAME_FIELD( ft_frame_long_le, s, f )
-#define FT_FRAME_ULONG_LE(s,f) FT_FRAME_FIELD( ft_frame_ulong_le, s, f )
-#define FT_FRAME_SHORT_LE(s,f) FT_FRAME_FIELD( ft_frame_short_le, s, f )
-#define FT_FRAME_USHORT_LE(s,f) FT_FRAME_FIELD( ft_frame_ushort_le, s, f )
+#define FT_FRAME_LONG_LE( s, f ) FT_FRAME_FIELD( ft_frame_long_le, s, f )
+#define FT_FRAME_ULONG_LE( s, f ) FT_FRAME_FIELD( ft_frame_ulong_le, s, f )
+#define FT_FRAME_SHORT_LE( s, f ) FT_FRAME_FIELD( ft_frame_short_le, s, f )
+#define FT_FRAME_USHORT_LE( s, f ) FT_FRAME_FIELD( ft_frame_ushort_le, s, f )
-#define FT_FRAME_SKIP_LONG { ft_frame_long_be, 0, 0 }
-#define FT_FRAME_SKIP_SHORT { ft_frame_short_be, 0, 0 }
-#define FT_FRAME_SKIP_BYTE { ft_frame_byte, 0, 0 }
+#define FT_FRAME_SKIP_LONG { ft_frame_long_be, 0, 0 }
+#define FT_FRAME_SKIP_SHORT { ft_frame_short_be, 0, 0 }
+#define FT_FRAME_SKIP_BYTE { ft_frame_byte, 0, 0 }
#define FT_FRAME_BYTES( struct_type, field, count ) \
{ \
ft_frame_bytes, \
count, \
- (FT_UShort)(char*)&FT_FIELD_REF(struct_type,field) }
-
-#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
+ (FT_UShort)(char*)&FT_FIELD_REF( struct_type, field ) \
+ }
+#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
/*************************************************************************/
/* */
- /* integer extraction macros - the `buffer' parameter must ALWAYS be of */
+ /* integer extraction macros -- the `buffer' parameter must ALWAYS be of */
/* type `char*' or equivalent (1-byte elements). */
/* */
-#define NEXT_Char(buffer) ((signed char)*buffer++)
-#define NEXT_Byte(buffer) ((unsigned char)*buffer++)
+#define NEXT_Char( buffer ) \
+ ( (signed char)*buffer++ )
+#define NEXT_Byte( buffer ) \
+ ( (unsigned char)*buffer++ )
-#define NEXT_Short(buffer) ( buffer += 2, \
- ( (short)((signed char)buffer[-2] << 8) | \
- (unsigned char)buffer[-1] ) )
+#define NEXT_Short( buffer ) \
+ ( buffer += 2, \
+ ( (short)( (signed char)buffer[-2] << 8 ) | \
+ (unsigned char)buffer[-1] ) )
-#define NEXT_UShort(buffer) ((unsigned short)NEXT_Short(buffer))
+#define NEXT_UShort( buffer ) \
+ ( (unsigned short)NEXT_Short( buffer ) )
-#define NEXT_Offset(buffer) ( buffer += 3, \
- ( ((long)(signed char)buffer[-3] << 16) | \
- ((long)(unsigned char)buffer[-2] << 8) | \
- (long)(unsigned char)buffer[-1] ) )
+#define NEXT_Offset( buffer ) \
+ ( buffer += 3, \
+ ( ( (long)(signed char)buffer[-3] << 16 ) | \
+ ( (long)(unsigned char)buffer[-2] << 8 ) | \
+ (long)(unsigned char)buffer[-1] ) )
-#define NEXT_UOffset(buffer) ((unsigned long)NEXT_Offset(buffer))
+#define NEXT_UOffset( buffer ) \
+ ( (unsigned long)NEXT_Offset( buffer ) )
-#define NEXT_Long(buffer) ( buffer += 4, \
- ( ((long)(signed char)buffer[-4] << 24) | \
- ((long)(unsigned char)buffer[-3] << 16) | \
- ((long)(unsigned char)buffer[-2] << 8) | \
- (long)(unsigned char)buffer[-1] ) )
+#define NEXT_Long( buffer ) \
+ ( buffer += 4, \
+ ( ( (long)(signed char)buffer[-4] << 24 ) | \
+ ( (long)(unsigned char)buffer[-3] << 16 ) | \
+ ( (long)(unsigned char)buffer[-2] << 8 ) | \
+ (long)(unsigned char)buffer[-1] ) )
-#define NEXT_ULong(buffer) ((unsigned long)NEXT_Long(buffer))
+#define NEXT_ULong( buffer ) \
+ ( (unsigned long)NEXT_Long( buffer ) )
-#define NEXT_ShortLE(buffer) ( buffer += 2, \
- ( (short)((signed char)buffer[-1] << 8) | \
- (unsigned char)buffer[-2] ) )
+#define NEXT_ShortLE( buffer ) \
+ ( buffer += 2, \
+ ( (short)( (signed char)buffer[-1] << 8 ) | \
+ (unsigned char)buffer[-2] ) )
-#define NEXT_UShortLE(buffer) ((unsigned short)NEXT_ShortLE(buffer))
+#define NEXT_UShortLE( buffer ) \
+ ( (unsigned short)NEXT_ShortLE( buffer ) )
-#define NEXT_OffsetLE(buffer) ( buffer += 3, \
- ( ((long)(signed char)buffer[-1] << 16) | \
- ((long)(unsigned char)buffer[-2] << 8) | \
- (long)(unsigned char)buffer[-3] ) )
+#define NEXT_OffsetLE( buffer ) \
+ ( buffer += 3, \
+ ( ( (long)(signed char)buffer[-1] << 16 ) | \
+ ( (long)(unsigned char)buffer[-2] << 8 ) | \
+ (long)(unsigned char)buffer[-3] ) )
-#define NEXT_UOffsetLE(buffer) ((unsigned long)NEXT_OffsetLE(buffer))
+#define NEXT_UOffsetLE( buffer ) \
+ ( (unsigned long)NEXT_OffsetLE( buffer ) )
-#define NEXT_LongLE(buffer) ( buffer += 4, \
- ( ((long)(signed char)buffer[-1] << 24) | \
- ((long)(unsigned char)buffer[-2] << 16) | \
- ((long)(unsigned char)buffer[-3] << 8) | \
- (long)(unsigned char)buffer[-4] ) )
+#define NEXT_LongLE( buffer ) \
+ ( buffer += 4, \
+ ( ( (long)(signed char)buffer[-1] << 24 ) | \
+ ( (long)(unsigned char)buffer[-2] << 16 ) | \
+ ( (long)(unsigned char)buffer[-3] << 8 ) | \
+ (long)(unsigned char)buffer[-4] ) )
-#define NEXT_ULongLE(buffer) ((unsigned long)NEXT_LongLE(buffer))
+#define NEXT_ULongLE( buffer ) \
+ ( (unsigned long)NEXT_LongLE( buffer ) )
+
/*************************************************************************/
/* */
/* Each GET_xxxx() macro uses an implicit `stream' variable. */
/* */
-#define FT_GET_MACRO( func, type ) ( (type)func(stream) )
+#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
-#define GET_Char() FT_GET_MACRO( FT_Get_Char, FT_Char )
-#define GET_Byte() FT_GET_MACRO( FT_Get_Char, FT_Byte )
-#define GET_Short() FT_GET_MACRO( FT_Get_Short, FT_Short )
-#define GET_UShort() FT_GET_MACRO( FT_Get_Short, FT_UShort )
-#define GET_Offset() FT_GET_MACRO( FT_Get_Offset, FT_Long )
-#define GET_UOffset() FT_GET_MACRO( FT_Get_Offset, FT_ULong )
-#define GET_Long() FT_GET_MACRO( FT_Get_Long, FT_Long )
-#define GET_ULong() FT_GET_MACRO( FT_Get_Long, FT_ULong )
-#define GET_Tag4() FT_GET_MACRO( FT_Get_Long, FT_ULong )
+#define GET_Char() FT_GET_MACRO( FT_Get_Char, FT_Char )
+#define GET_Byte() FT_GET_MACRO( FT_Get_Char, FT_Byte )
+#define GET_Short() FT_GET_MACRO( FT_Get_Short, FT_Short )
+#define GET_UShort() FT_GET_MACRO( FT_Get_Short, FT_UShort )
+#define GET_Offset() FT_GET_MACRO( FT_Get_Offset, FT_Long )
+#define GET_UOffset() FT_GET_MACRO( FT_Get_Offset, FT_ULong )
+#define GET_Long() FT_GET_MACRO( FT_Get_Long, FT_Long )
+#define GET_ULong() FT_GET_MACRO( FT_Get_Long, FT_ULong )
+#define GET_Tag4() FT_GET_MACRO( FT_Get_Long, FT_ULong )
#define GET_ShortLE() FT_GET_MACRO( FT_Get_ShortLE, FT_Short )
#define GET_UShortLE() FT_GET_MACRO( FT_Get_ShortLE, FT_UShort )
-#define GET_LongLE() FT_GET_MACRO( FT_Get_LongLE, FT_Short )
-#define GET_ULongLE() FT_GET_MACRO( FT_Get_LongLE, FT_Short )
+#define GET_LongLE() FT_GET_MACRO( FT_Get_LongLE, FT_Short )
+#define GET_ULongLE() FT_GET_MACRO( FT_Get_LongLE, FT_Short )
#define FT_READ_MACRO( func, type, var ) \
( var = (type)func( stream, &error ), \
error != FT_Err_Ok )
-#define READ_Byte( var ) FT_READ_MACRO( FT_Read_Char, FT_Byte, var )
-#define READ_Char( var ) FT_READ_MACRO( FT_Read_Char, FT_Char, var )
-#define READ_Short( var ) FT_READ_MACRO( FT_Read_Short, FT_Short, var )
-#define READ_UShort( var ) FT_READ_MACRO( FT_Read_Short, FT_UShort, var )
-#define READ_Offset( var ) FT_READ_MACRO( FT_Read_Offset, FT_Long, var )
-#define READ_UOffset( var ) FT_READ_MACRO( FT_Read_Offset, FT_ULong, var )
-#define READ_Long( var ) FT_READ_MACRO( FT_Read_Long, FT_Long, var )
-#define READ_ULong( var ) FT_READ_MACRO( FT_Read_Long, FT_ULong, var )
+#define READ_Byte( var ) FT_READ_MACRO( FT_Read_Char, FT_Byte, var )
+#define READ_Char( var ) FT_READ_MACRO( FT_Read_Char, FT_Char, var )
+#define READ_Short( var ) FT_READ_MACRO( FT_Read_Short, FT_Short, var )
+#define READ_UShort( var ) FT_READ_MACRO( FT_Read_Short, FT_UShort, var )
+#define READ_Offset( var ) FT_READ_MACRO( FT_Read_Offset, FT_Long, var )
+#define READ_UOffset( var ) FT_READ_MACRO( FT_Read_Offset, FT_ULong, var )
+#define READ_Long( var ) FT_READ_MACRO( FT_Read_Long, FT_Long, var )
+#define READ_ULong( var ) FT_READ_MACRO( FT_Read_Long, FT_ULong, var )
-#define READ_ShortLE( var ) FT_READ_MACRO( FT_Read_ShortLE, FT_Short, var )
-#define READ_UShortLE( var ) FT_READ_MACRO( FT_Read_ShortLE, FT_UShort, var )
-#define READ_LongLE( var ) FT_READ_MACRO( FT_Read_LongLE, FT_Long, var )
-#define READ_ULongLE( var ) FT_READ_MACRO( FT_Read_LongLE, FT_ULong, var )
+#define READ_ShortLE( var ) FT_READ_MACRO( FT_Read_ShortLE, FT_Short, var )
+#define READ_UShortLE( var ) FT_READ_MACRO( FT_Read_ShortLE, FT_UShort, var )
+#define READ_LongLE( var ) FT_READ_MACRO( FT_Read_LongLE, FT_Long, var )
+#define READ_ULongLE( var ) FT_READ_MACRO( FT_Read_LongLE, FT_ULong, var )
- BASE_DEF(void) FT_New_Memory_Stream( FT_Library library,
- FT_Byte* base,
- FT_ULong size,
- FT_Stream stream );
+ BASE_DEF( void ) FT_New_Memory_Stream( FT_Library library,
+ FT_Byte* base,
+ FT_ULong size,
+ FT_Stream stream );
- BASE_DEF(FT_Error) FT_Seek_Stream( FT_Stream stream,
- FT_ULong pos );
+ BASE_DEF( FT_Error ) FT_Seek_Stream( FT_Stream stream,
+ FT_ULong pos );
- BASE_DEF(FT_Error) FT_Skip_Stream( FT_Stream stream,
- FT_Long distance );
+ BASE_DEF( FT_Error ) FT_Skip_Stream( FT_Stream stream,
+ FT_Long distance );
- BASE_DEF(FT_Long) FT_Stream_Pos( FT_Stream stream );
+ BASE_DEF( FT_Long ) FT_Stream_Pos( FT_Stream stream );
- BASE_DEF(FT_Error) FT_Read_Stream( FT_Stream stream,
- FT_Byte* buffer,
- FT_ULong count );
+ BASE_DEF( FT_Error ) FT_Read_Stream( FT_Stream stream,
+ FT_Byte* buffer,
+ FT_ULong count );
- BASE_DEF(FT_Error) FT_Read_Stream_At( FT_Stream stream,
- FT_ULong pos,
- FT_Byte* buffer,
+ BASE_DEF( FT_Error ) FT_Read_Stream_At( FT_Stream stream,
+ FT_ULong pos,
+ FT_Byte* buffer,
+ FT_ULong count );
+
+ BASE_DEF( FT_Error ) FT_Access_Frame( FT_Stream stream,
FT_ULong count );
- BASE_DEF(FT_Error) FT_Access_Frame( FT_Stream stream,
- FT_ULong count );
+ BASE_DEF( void ) FT_Forget_Frame( FT_Stream stream );
- BASE_DEF(void) FT_Forget_Frame( FT_Stream stream );
+ BASE_DEF( FT_Error ) FT_Extract_Frame( FT_Stream stream,
+ FT_ULong count,
+ FT_Byte** pbytes );
- BASE_DEF(FT_Error) FT_Extract_Frame( FT_Stream stream,
- FT_ULong count,
- FT_Byte* *pbytes );
+ BASE_DEF( void ) FT_Release_Frame( FT_Stream stream,
+ FT_Byte** pbytes );
- BASE_DEF(void) FT_Release_Frame( FT_Stream stream,
- FT_Byte* *pbytes );
+ BASE_DEF( FT_Char ) FT_Get_Char( FT_Stream stream );
- BASE_DEF(FT_Char) FT_Get_Char( FT_Stream stream );
+ BASE_DEF( FT_Short ) FT_Get_Short( FT_Stream stream );
- BASE_DEF(FT_Short) FT_Get_Short( FT_Stream stream );
+ BASE_DEF( FT_Long ) FT_Get_Offset( FT_Stream stream );
- BASE_DEF(FT_Long) FT_Get_Offset( FT_Stream stream );
+ BASE_DEF( FT_Long ) FT_Get_Long( FT_Stream stream );
- BASE_DEF(FT_Long) FT_Get_Long( FT_Stream stream );
+ BASE_DEF( FT_Short ) FT_Get_ShortLE( FT_Stream stream );
- BASE_DEF(FT_Short) FT_Get_ShortLE( FT_Stream stream );
+ BASE_DEF( FT_Long ) FT_Get_LongLE( FT_Stream stream );
- BASE_DEF(FT_Long) FT_Get_LongLE( FT_Stream stream );
+ BASE_DEF( FT_Char ) FT_Read_Char( FT_Stream stream,
+ FT_Error* error );
- BASE_DEF(FT_Char) FT_Read_Char( FT_Stream stream,
- FT_Error* error );
+ BASE_DEF( FT_Short ) FT_Read_Short( FT_Stream stream,
+ FT_Error* error );
- BASE_DEF(FT_Short) FT_Read_Short( FT_Stream stream,
+ BASE_DEF( FT_Long ) FT_Read_Offset( FT_Stream stream,
+ FT_Error* error );
+
+ BASE_DEF( FT_Long ) FT_Read_Long( FT_Stream stream,
FT_Error* error );
- BASE_DEF(FT_Long) FT_Read_Offset( FT_Stream stream,
- FT_Error* error );
+ BASE_DEF( FT_Short ) FT_Read_ShortLE( FT_Stream stream,
+ FT_Error* error );
- BASE_DEF(FT_Long) FT_Read_Long( FT_Stream stream,
- FT_Error* error );
-
- BASE_DEF(FT_Short) FT_Read_ShortLE( FT_Stream stream,
+ BASE_DEF( FT_Long ) FT_Read_LongLE( FT_Stream stream,
FT_Error* error );
- BASE_DEF(FT_Long) FT_Read_LongLE( FT_Stream stream,
- FT_Error* error );
+ BASE_DEF( FT_Error ) FT_Read_Fields( FT_Stream stream,
+ const FT_Frame_Field* fields,
+ void* structure );
- BASE_DEF(FT_Error) FT_Read_Fields( FT_Stream stream,
- const FT_Frame_Field* fields,
- void* structure );
-#define USE_Stream( resource, stream ) \
+#define USE_Stream( resource, stream ) \
FT_SET_ERROR( FT_Open_Stream( resource, stream ) )
-#define DONE_Stream( stream ) \
+#define DONE_Stream( stream ) \
FT_Done_Stream( stream )
-#define ACCESS_Frame( size ) \
+#define ACCESS_Frame( size ) \
FT_SET_ERROR( FT_Access_Frame( stream, size ) )
-#define FORGET_Frame() \
+#define FORGET_Frame() \
FT_Forget_Frame( stream )
-#define EXTRACT_Frame( size, bytes ) \
- FT_SET_ERROR( FT_Extract_Frame( stream, size, (FT_Byte**)&(bytes) ) )
+#define EXTRACT_Frame( size, bytes ) \
+ FT_SET_ERROR( FT_Extract_Frame( stream, size, \
+ (FT_Byte**)&(bytes) ) )
-#define RELEASE_Frame( bytes ) \
+#define RELEASE_Frame( bytes ) \
FT_Release_Frame( stream, (FT_Byte**)&(bytes) )
-#define FILE_Seek( position ) \
+#define FILE_Seek( position ) \
FT_SET_ERROR( FT_Seek_Stream( stream, position ) )
-#define FILE_Skip( distance ) \
+#define FILE_Skip( distance ) \
FT_SET_ERROR( FT_Skip_Stream( stream, distance ) )
-#define FILE_Pos() \
+#define FILE_Pos() \
FT_Stream_Pos( stream )
#define FILE_Read( buffer, count ) \
@@ -309,7 +347,7 @@
count ) )
#define READ_Fields( fields, object ) \
- ((error = FT_Read_Fields( stream, fields, object )) != FT_Err_Ok)
+ ( ( error = FT_Read_Fields( stream, fields, object ) ) != FT_Err_Ok )
#ifdef __cplusplus
@@ -318,3 +356,6 @@
#endif /* FTSTREAM_H */
+
+
+/* END */
--- a/include/freetype/internal/psnames.h
+++ b/include/freetype/internal/psnames.h
@@ -2,8 +2,8 @@
/* */
/* psnames.h */
/* */
-/* High-level interface for the "psnames" module (in charge of */
-/* various functions related to Postscript glyph names conversion) */
+/* High-level interface for the `PSNames' module (in charge of */
+/* various functions related to Postscript glyph names conversion). */
/* */
/* Copyright 1996-2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
@@ -16,122 +16,99 @@
/* */
/***************************************************************************/
+
#ifndef PSNAMES_H
#define PSNAMES_H
+
#include <freetype/freetype.h>
- /**************************************************************************
- *
- * <FuncType>
- * PS_Unicode_Value_Func
- *
- * <Description>
- * A function used to return the Unicode index corresponding to a
- * given glyph name.
- *
- * <Input>
- * glyph_name :: the glyph name
- *
- * <Return>
- * The Unicode character index. The non-Unicode value 0xFFFF if the
- * glyph name has no known Unicode meaning..
- *
- * <Note>
- * This function is able to map several different glyph names to the
- * same Unicode value, according to the rules defined in the Adobe
- * Glyph List table.
- *
- * This function will not be compiled if the configuration macro
- * FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined.
- *
- **************************************************************************/
- typedef FT_ULong (*PS_Unicode_Value_Func)( const char* glyph_name );
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* PS_Unicode_Value_Func */
+ /* */
+ /* <Description> */
+ /* A function used to return the Unicode index corresponding to a */
+ /* given glyph name. */
+ /* */
+ /* <Input> */
+ /* glyph_name :: The glyph name. */
+ /* */
+ /* <Return> */
+ /* The Unicode character index resp. the non-Unicode value 0xFFFF if */
+ /* the glyph name has no known Unicode meaning. */
+ /* */
+ /* <Note> */
+ /* This function is able to map several different glyph names to the */
+ /* same Unicode value, according to the rules defined in the Adobe */
+ /* Glyph List table. */
+ /* */
+ /* This function will not be compiled if the configuration macro */
+ /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined. */
+ /* */
+ typedef FT_ULong (*PS_Unicode_Value_Func)( const char* glyph_name );
- /**************************************************************************
- *
- * <FuncType>
- * PS_Unicode_Index_Func
- *
- * <Description>
- * A function used to return the glyph index corresponding to
- * a given unicode value.
- *
- * <Input>
- * num_glyphs :: number of glyphs in face
- * glyph_names :: array of glyph name pointers
- * uncode :: unicode value.
- *
- * <Return>
- * The glyph index. 0xFFFF is no glyph correspond to this Unicode
- * value..
- *
- * <Note>
- * This function is able to recognize several glyph names per
- * unicode values, according to the Adobe Glyph List.
- *
- * This function will not be compiled if the configuration macro
- * FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined.
- *
- **************************************************************************/
-
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* PS_Unicode_Index_Func */
+ /* */
+ /* <Description> */
+ /* A function used to return the glyph index corresponding to a given */
+ /* Unicode value. */
+ /* */
+ /* <Input> */
+ /* num_glyphs :: The number of glyphs in the face. */
+ /* */
+ /* glyph_names :: An array of glyph name pointers. */
+ /* */
+ /* unicode :: The Unicode value. */
+ /* */
+ /* <Return> */
+ /* The glyph index resp. 0xFFFF if no glyph corresponds to this */
+ /* Unicode value. */
+ /* */
+ /* <Note> */
+ /* This function is able to recognize several glyph names per Unicode */
+ /* value, according to the Adobe Glyph List. */
+ /* */
+ /* This function will not be compiled if the configuration macro */
+ /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined. */
+ /* */
typedef FT_UInt (*PS_Unicode_Index_Func)( FT_UInt num_glyphs,
const char** glyph_names,
FT_ULong unicode );
- /**************************************************************************
- *
- * <FuncType>
- * PS_Macintosh_Name_Func
- *
- * <Description>
- * A function used to return the glyph name corresponding to one
- * Apple glyph name index.
- *
- * <Input>
- * name_index :: index of the Mac name
- *
- * <Return>
- * The glyph name, or 0 if the index is incorrect.
- *
- * <Note>
- * This function will not be compiled if the configuration macro
- * FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined
- *
- **************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* PS_Macintosh_Name_Func */
+ /* */
+ /* <Description> */
+ /* A function used to return the glyph name corresponding to an Apple */
+ /* glyph name index. */
+ /* */
+ /* <Input> */
+ /* name_index :: The index of the Mac name. */
+ /* */
+ /* <Return> */
+ /* The glyph name, or 0 if the index is invalid. */
+ /* */
+ /* <Note> */
+ /* This function will not be compiled if the configuration macro */
+ /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined. */
+ /* */
typedef const char* (*PS_Macintosh_Name_Func)( FT_UInt name_index );
-
typedef const char* (*PS_Adobe_Std_Strings_Func)( FT_UInt string_index );
- /***************************************************************************
- *
- * <Struct>
- * PS_Unicodes
- *
- * <Description>
- * a simple table used to map Unicode values to glyph indices. It is
- * built by the PS_Build_Unicodes table according to the glyphs present
- * in a font file..
- *
- * <Fields>
- * num_codes :: number of glyphs in the font that match a given Unicode
- * value..
- *
- * unicodes :: array of unicode values, sorted in increasing order
- * gindex :: array of glyph indices, corresponding to each unicode
- *
- * <Note>
- * Use the function PS_Lookup_Unicode to retrieve the glyph index
- * corresponding to a given Unicode character code.
- *
- ***************************************************************************/
- typedef struct PS_UniMap_
+ typedef struct PS_UniMap_
{
FT_UInt unicode;
FT_UInt glyph_index;
@@ -138,10 +115,35 @@
} PS_UniMap;
- typedef struct PS_Unicodes_
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* PS_Unicodes */
+ /* */
+ /* <Description> */
+ /* A simple table used to map Unicode values to glyph indices. It is */
+ /* built by the PS_Build_Unicodes table according to the glyphs */
+ /* present in a font file. */
+ /* */
+ /* <Fields> */
+ /* num_codes :: The number of glyphs in the font that match a given */
+ /* Unicode value. */
+ /* */
+ /* unicodes :: An array of unicode values, sorted in increasing */
+ /* order. */
+ /* */
+ /* gindex :: An array of glyph indices, corresponding to each */
+ /* Unicode value. */
+ /* */
+ /* <Note> */
+ /* Use the function PS_Lookup_Unicode() to retrieve the glyph index */
+ /* corresponding to a given Unicode character code. */
+ /* */
+ typedef struct PS_Unicodes_
{
- FT_UInt num_maps;
- PS_UniMap* maps;
+ FT_UInt num_maps;
+ PS_UniMap* maps;
} PS_Unicodes;
@@ -151,49 +153,53 @@
const char** glyph_names,
PS_Unicodes* unicodes );
- typedef FT_UInt (*PS_Lookup_Unicode_Func)( PS_Unicodes* unicodes,
- FT_UInt unicode );
+ typedef FT_UInt (*PS_Lookup_Unicode_Func)( PS_Unicodes* unicodes,
+ FT_UInt unicode );
- /*************************************************************************
- *
- * <Struct>
- * PSNames_Interface
- *
- * <Description>
- * this structure holds pointers to the functions used to load and
- * free the basic tables that are required in a `sfnt' font file.
- *
- * <Fields>
- * unicode_value :: a function used to convert a glyph name into
- * a Unicode character code
- *
- * unicode_index :: a function used to return the glyph index
- * corresponding to a given Unicode character
- *
- * macintosh_name :: a function used to return the standard Apple
- * glyph Postscript name corresponding to a given
- * string index (used by the TrueType "post" table)
- *
- * adobe_std_strings :: a function that returns a pointer to a given
- * Adobe Standard Strings given a SID
- *
- * adobe_std_encoding :: a table of 256 unsigned shorts that maps
- * character codes in the Adobe Standard Encoding
- * to SIDs
- *
- * adobe_expert_encoding :: a table of 256 unsigned shorts that maps
- * character codes in the Adobe Expert Encoding
- * to SIDs.
- *
- * <Note>
- * The 'unicode_value' and 'unicode_index' will be set to 0 if the
- * configuration macro FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined
- *
- * The 'macintosh_name' will be set to 0 if the configuration macro
- * FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined
- *
- *************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* PSNames_Interface */
+ /* */
+ /* <Description> */
+ /* This structure defines the PSNames interface. */
+ /* */
+ /* <Fields> */
+ /* unicode_value :: A function used to convert a glyph name */
+ /* into a Unicode character code. */
+ /* */
+ /* build_unicodes :: A function which builds up the Unicode */
+ /* mapping table. */
+ /* */
+ /* lookup_unicode :: A function used to return the glyph index */
+ /* corresponding to a given Unicode */
+ /* character. */
+ /* */
+ /* macintosh_name :: A function used to return the standard */
+ /* Apple glyph Postscript name corresponding */
+ /* to a given string index (used by the */
+ /* TrueType `post' table). */
+ /* */
+ /* adobe_std_strings :: A function that returns a pointer to a */
+ /* Adobe Standard String for a given SID. */
+ /* */
+ /* adobe_std_encoding :: A table of 256 unsigned shorts that maps */
+ /* character codes in the Adobe Standard */
+ /* Encoding to SIDs. */
+ /* */
+ /* adobe_expert_encoding :: A table of 256 unsigned shorts that maps */
+ /* character codes in the Adobe Expert */
+ /* Encoding to SIDs. */
+ /* */
+ /* <Note> */
+ /* `unicode_value' and `unicode_index' will be set to 0 if the */
+ /* configuration macro FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is */
+ /* undefined. */
+ /* */
+ /* `macintosh_name' will be set to 0 if the configuration macro */
+ /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined. */
+ /* */
typedef struct PSNames_Interface_
{
PS_Unicode_Value_Func unicode_value;
@@ -207,8 +213,8 @@
} PSNames_Interface;
-#endif /* PSNAMES_H */
+#endif /* PSNAMES_H */
/* END */
--- a/include/freetype/internal/sfnt.h
+++ b/include/freetype/internal/sfnt.h
@@ -19,6 +19,7 @@
#ifndef SFNT_H
#define SFNT_H
+
#include <freetype/freetype.h>
#include <freetype/internal/ftdriver.h>
#include <freetype/internal/tttypes.h>
@@ -30,28 +31,34 @@
/* TT_Init_Face_Func */
/* */
/* <Description> */
- /* First part of the SFNT face object initialisation. This will */
- /* find the face in a SFNT file or collection, and load its */
- /* format tag in face->format_tag. */
+ /* First part of the SFNT face object initialization. This will find */
+ /* the face in a SFNT file or collection, and load its format tag in */
+ /* face->format_tag. */
/* */
/* <Input> */
/* stream :: The input stream. */
+ /* */
/* face :: A handle to the target face object. */
- /* faceIndex :: The index of the TrueType font, if we're opening a */
+ /* */
+ /* face_index :: The index of the TrueType font, if we are opening a */
/* collection. */
- /* num_params :: number of additional parameters */
- /* params :: optional additional parameters */
/* */
+ /* num_params :: The number of additional parameters. */
+ /* */
+ /* params :: Optional additional parameters. */
+ /* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
- /* The stream cursor must be at the font file's origin */
- /* This function recognizes fonts embedded in a "TrueType collection" */
+ /* The stream cursor must be at the font file's origin. */
/* */
+ /* This function recognizes fonts embedded in a `TrueType */
+ /* collection'. */
+ /* */
/* Once the format tag has been validated by the font driver, it */
- /* should then call the TT_Load_Face_Func callback to read the rest */
- /* of the SFNT tables in the object.. */
+ /* should then call the TT_Load_Face_Func() callback to read the rest */
+ /* of the SFNT tables in the object. */
/* */
typedef
FT_Error (*TT_Init_Face_Func)( FT_Stream stream,
@@ -60,6 +67,7 @@
FT_Int num_params,
FT_Parameter* params );
+
/*************************************************************************/
/* */
/* <FuncType> */
@@ -66,23 +74,27 @@
/* TT_Load_Face_Func */
/* */
/* <Description> */
- /* Second part of the SFNT face object initialisation. This will */
- /* load the common SFNT tables (head, OS/2, maxp, metrics, etc..) */
- /* in the face object.. */
+ /* Second part of the SFNT face object initialization. This will */
+ /* load the common SFNT tables (head, OS/2, maxp, metrics, etc.) in */
+ /* the face object. */
/* */
/* <Input> */
/* stream :: The input stream. */
+ /* */
/* face :: A handle to the target face object. */
- /* faceIndex :: The index of the TrueType font, if we're opening a */
+ /* */
+ /* face_index :: The index of the TrueType font, if we are opening a */
/* collection. */
- /* num_params :: number of additional parameters */
- /* params :: optional additional parameters */
/* */
+ /* num_params :: The number of additional parameters. */
+ /* */
+ /* params :: Optional additional parameters. */
+ /* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
- /* This function must be called after TT_Init_Face_Func */
+ /* This function must be called after TT_Init_Face_Func(). */
/* */
typedef
FT_Error (*TT_Load_Face_Func)( FT_Stream stream,
@@ -91,6 +103,7 @@
FT_Int num_params,
FT_Parameter* params );
+
/*************************************************************************/
/* */
/* <FuncType> */
@@ -100,13 +113,13 @@
/* A callback used to delete the common SFNT data from a face. */
/* */
/* <Input> */
- /* face :: A handle to the target face object. */
+ /* face :: A handle to the target face object. */
/* */
/* <Note> */
- /* This function does NOT destroy the face object.. */
+ /* This function does NOT destroy the face object. */
/* */
typedef
- void (*TT_Done_Face_Func)( TT_Face face );
+ void (*TT_Done_Face_Func)( TT_Face face );
typedef
@@ -117,34 +130,41 @@
/*************************************************************************/
/* */
/* <FuncType> */
- /* TT_Load_SFNT_Header */
+ /* TT_Load_SFNT_Header_Func */
/* */
/* <Description> */
- /* Loads the header of a SFNT font file. Supports collections.. */
+ /* Loads the header of a SFNT font file. Supports collections. */
/* */
/* <Input> */
- /* face :: A handle to the target face object. */
- /* stream :: The input stream. */
+ /* face :: A handle to the target face object. */
/* */
+ /* stream :: The input stream. */
+ /* */
+ /* face_index :: The index of the TrueType font, if we are opening a */
+ /* collection. */
+ /* */
/* <Output> */
- /* sfnt :: the sfnt header */
+ /* sfnt :: The SFNT header. */
/* */
/* <Return> */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
/* <Note> */
- /* The stream cursor must be at the font file's origin */
- /* This function recognizes fonts embedded in a "TrueType collection" */
+ /* The stream cursor must be at the font file's origin. */
/* */
+ /* This function recognizes fonts embedded in a `TrueType */
+ /* collection'. */
+ /* */
/* This function checks that the header is valid by looking at the */
- /* values of "search_range", "entry_selector" and "range_shift".. */
+ /* values of `search_range', `entry_selector', and `range_shift'. */
/* */
typedef
- FT_Error (*TT_Load_SFNT_Header_Func)( TT_Face face,
- FT_Stream stream,
- FT_Long faceIndex,
- SFNT_Header* sfnt );
+ FT_Error (*TT_Load_SFNT_Header_Func)( TT_Face face,
+ FT_Stream stream,
+ FT_Long face_index,
+ SFNT_Header* sfnt );
+
/*************************************************************************/
/* */
/* <FuncType> */
@@ -155,16 +175,18 @@
/* */
/* <Input> */
/* face :: A handle to the target face object. */
+ /* */
/* stream :: The input stream. */
- /* sfnt :: sfnt header */
/* */
+ /* sfnt :: The SFNT header. */
+ /* */
/* <Return> */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
/* <Note> */
- /* The stream cursor must be on the first byte after the 4-byte */
- /* font format tag. This is the case just after a call to */
- /* TT_Load_Format_Tag */
+ /* The stream cursor must be on the first byte after the 4-byte font */
+ /* format tag. This is the case just after a call to */
+ /* TT_Load_Format_Tag(). */
/* */
typedef
FT_Error (*TT_Load_Directory_Func)( TT_Face face,
@@ -178,13 +200,12 @@
/* TT_Load_Any_Func */
/* */
/* <Description> */
- /* Loads any font table into client memory. Used by the */
- /* TT_Get_Font_Data() API function. */
+ /* Loads any font table into client memory. */
/* */
/* <Input> */
/* face :: The face object to look for. */
/* */
- /* tag :: The tag of table to load. Use the value 0 if you want */
+ /* tag :: The tag of table to load. Use the value 0 if you want */
/* to access the whole font file, else set this parameter */
/* to a valid TrueType table tag that you can forge with */
/* the MAKE_TT_TAG macro. */
@@ -243,10 +264,11 @@
/* */
/* <Output> */
/* map :: The target pixmap. */
+ /* */
/* metrics :: A big sbit metrics structure for the glyph image. */
/* */
/* <Return> */
- /* TrueType error code. 0 means success. Returns an error if no */
+ /* FreeType error code. 0 means success. Returns an error if no */
/* glyph sbit exists for the index. */
/* */
/* <Note> */
@@ -262,6 +284,7 @@
FT_Bitmap* map,
TT_SBit_Metrics* metrics );
+
/*************************************************************************/
/* */
/* <FuncType> */
@@ -279,18 +302,18 @@
/* You must not modify the returned string! */
/* */
/* <Output> */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
typedef
- FT_Error (*TT_Get_PS_Name_Func)( TT_Face face,
- FT_UInt index,
- FT_String** PSname );
+ FT_Error (*TT_Get_PS_Name_Func)( TT_Face face,
+ FT_UInt index,
+ FT_String** PSname );
/*************************************************************************/
/* */
/* <FuncType> */
- /* TT_Load_Metrics */
+ /* TT_Load_Metrics_Func */
/* */
/* <Description> */
/* Loads the horizontal or vertical header in a face object. */
@@ -297,11 +320,13 @@
/* */
/* <Input> */
/* face :: A handle to the target face object. */
+ /* */
/* stream :: The input stream. */
+ /* */
/* vertical :: A boolean flag. If set, load vertical metrics. */
/* */
/* <Return> */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
typedef
FT_Error (*TT_Load_Metrics_Func)( TT_Face face,
@@ -309,7 +334,6 @@
FT_Bool vertical );
-
/*************************************************************************/
/* */
/* <FuncType> */
@@ -320,6 +344,7 @@
/* */
/* <Input> */
/* face :: A handle to the parent face object. */
+ /* */
/* stream :: A handle to the current stream object. */
/* */
/* <InOut> */
@@ -326,7 +351,7 @@
/* cmap :: A pointer to a cmap object. */
/* */
/* <Return> */
- /* Error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The function assumes that the stream is already in use (i.e., */
@@ -349,10 +374,11 @@
/* */
/* <Input> */
/* face :: A handle to the parent face object. */
+ /* */
/* cmap :: A handle to a cmap object. */
/* */
/* <Return> */
- /* Error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
typedef
FT_Error (*TT_CharMap_Free_Func)( TT_Face face,
@@ -362,7 +388,7 @@
/*************************************************************************/
/* */
/* <FuncType> */
- /* TT_Load_Table */
+ /* TT_Load_Table_Func */
/* */
/* <Description> */
/* Loads a given TrueType table. */
@@ -369,14 +395,15 @@
/* */
/* <Input> */
/* face :: A handle to the target face object. */
+ /* */
/* stream :: The input stream. */
/* */
/* <Return> */
- /* TrueType error code. 0 means success. */
+ /* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The function will use `face->goto_table' to seek the stream to */
- /* the start of the table */
+ /* the start of the table. */
/* */
typedef
FT_Error (*TT_Load_Table_Func)( TT_Face face,
@@ -386,27 +413,18 @@
/*************************************************************************/
/* */
/* <FuncType> */
- /* TT_Load_Table */
+ /* TT_Free_Table_Func */
/* */
/* <Description> */
- /* Loads a given TrueType table. */
+ /* Frees a given TrueType table. */
/* */
/* <Input> */
- /* face :: A handle to the target face object. */
- /* stream :: The input stream. */
+ /* face :: A handle to the target face object. */
/* */
- /* <Return> */
- /* TrueType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The function will use `face->goto_table' to seek the stream to */
- /* the start of the table */
- /* */
typedef
void (*TT_Free_Table_Func)( TT_Face face );
-
/*************************************************************************/
/* */
/* <Struct> */
@@ -413,65 +431,60 @@
/* SFNT_Interface */
/* */
/* <Description> */
- /* this structure holds pointers to the functions used to load and */
+ /* This structure holds pointers to the functions used to load and */
/* free the basic tables that are required in a `sfnt' font file. */
/* */
/* <Fields> */
+ /* Check the various xxx_Func() descriptions for details. */
/* */
- /* */
- /* */
- /* */
- /* */
- /* */
- /* */
- /* */
typedef struct SFNT_Interface_
{
- TT_Goto_Table_Func goto_table;
+ TT_Goto_Table_Func goto_table;
- TT_Init_Face_Func init_face;
- TT_Load_Face_Func load_face;
- TT_Done_Face_Func done_face;
- SFNT_Get_Interface_Func get_interface;
+ TT_Init_Face_Func init_face;
+ TT_Load_Face_Func load_face;
+ TT_Done_Face_Func done_face;
+ SFNT_Get_Interface_Func get_interface;
- TT_Load_Any_Func load_any;
- TT_Load_SFNT_Header_Func load_sfnt_header;
- TT_Load_Directory_Func load_directory;
+ TT_Load_Any_Func load_any;
+ TT_Load_SFNT_Header_Func load_sfnt_header;
+ TT_Load_Directory_Func load_directory;
- /* these functions are called by "load_face" but they can also */
- /* be called from external modules, if there is a need to */
- TT_Load_Table_Func load_header;
- TT_Load_Metrics_Func load_metrics;
- TT_Load_Table_Func load_charmaps;
- TT_Load_Table_Func load_max_profile;
- TT_Load_Table_Func load_os2;
- TT_Load_Table_Func load_psnames;
+ /* these functions are called by `load_face' but they can also */
+ /* be called from external modules, if there is a need to do so */
+ TT_Load_Table_Func load_header;
+ TT_Load_Metrics_Func load_metrics;
+ TT_Load_Table_Func load_charmaps;
+ TT_Load_Table_Func load_max_profile;
+ TT_Load_Table_Func load_os2;
+ TT_Load_Table_Func load_psnames;
- TT_Load_Table_Func load_names;
- TT_Free_Table_Func free_names;
+ TT_Load_Table_Func load_names;
+ TT_Free_Table_Func free_names;
/* optional tables */
- TT_Load_Table_Func load_hdmx;
- TT_Free_Table_Func free_hdmx;
+ TT_Load_Table_Func load_hdmx;
+ TT_Free_Table_Func free_hdmx;
- TT_Load_Table_Func load_kerning;
- TT_Load_Table_Func load_gasp;
- TT_Load_Table_Func load_pclt;
+ TT_Load_Table_Func load_kerning;
+ TT_Load_Table_Func load_gasp;
+ TT_Load_Table_Func load_pclt;
/* see `ttsbit.h' */
- TT_Load_Table_Func load_sbits;
- TT_Load_SBit_Image_Func load_sbit_image;
- TT_Free_Table_Func free_sbits;
+ TT_Load_Table_Func load_sbits;
+ TT_Load_SBit_Image_Func load_sbit_image;
+ TT_Free_Table_Func free_sbits;
/* see `ttpost.h' */
- TT_Get_PS_Name_Func get_psname;
- TT_Free_Table_Func free_psnames;
+ TT_Get_PS_Name_Func get_psname;
+ TT_Free_Table_Func free_psnames;
/* see `ttcmap.h' */
- TT_CharMap_Load_Func load_charmap;
- TT_CharMap_Free_Func free_charmap;
+ TT_CharMap_Load_Func load_charmap;
+ TT_CharMap_Free_Func free_charmap;
} SFNT_Interface;
+
#endif /* SFNT_H */
--- a/include/freetype/internal/t1errors.h
+++ b/include/freetype/internal/t1errors.h
@@ -1,63 +1,67 @@
-/*******************************************************************
- *
- * t1errors.h
- *
- * Type1 Error ID definitions
- *
- * Copyright 1996-1998 by
- * David Turner, Robert Wilhelm, and Werner Lemberg.
- *
- * This file is part of the FreeType project, and may only be used
- * modified and distributed under the terms of the FreeType project
- * license, LICENSE.TXT. By continuing to use, modify, or distribute
- * this file you indicate that you have read the license and
- * understand and accept it fully.
- *
- ******************************************************************/
+/***************************************************************************/
+/* */
+/* t1errors.h */
+/* */
+/* Type 1 error ID definitions (specification only). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
#ifndef T1ERRORS_H
#define T1ERRORS_H
+
/************************ error codes declaration **************/
- /* The error codes are grouped in 'classes' used to indicate the */
- /* 'level' at which the error happened. */
- /* The class is given by an error code's high byte. */
+ /* The error codes are grouped into `classes' used to indicate the */
+ /* `level' at which the error happened. */
+ /* */
+ /* The class is given by an error code's high byte. */
-/* ------------- Success is always 0 -------- */
+ /* ------------- Success is always 0 -------- */
-#define T1_Err_Ok FT_Err_Ok
+#define T1_Err_Ok FT_Err_Ok
-/* ----------- high level API errors -------- */
+ /* ----------- high level API errors -------- */
-#define T1_Err_Invalid_File_Format FT_Err_Invalid_File_Format
-#define T1_Err_Invalid_Argument FT_Err_Invalid_Argument
-#define T1_Err_Invalid_Driver_Handle FT_Err_Invalid_Driver_Handle
-#define T1_Err_Invalid_Face_Handle FT_Err_Invalid_Face_Handle
-#define T1_Err_Invalid_Size_Handle FT_Err_Invalid_Size_Handle
-#define T1_Err_Invalid_Glyph_Handle FT_Err_Invalid_Slot_Handle
-#define T1_Err_Invalid_CharMap_Handle FT_Err_Invalid_CharMap_Handle
-#define T1_Err_Invalid_Glyph_Index FT_Err_Invalid_Glyph_Index
+#define T1_Err_Invalid_File_Format FT_Err_Invalid_File_Format
+#define T1_Err_Invalid_Argument FT_Err_Invalid_Argument
+#define T1_Err_Invalid_Driver_Handle FT_Err_Invalid_Driver_Handle
+#define T1_Err_Invalid_Face_Handle FT_Err_Invalid_Face_Handle
+#define T1_Err_Invalid_Size_Handle FT_Err_Invalid_Size_Handle
+#define T1_Err_Invalid_Glyph_Handle FT_Err_Invalid_Slot_Handle
+#define T1_Err_Invalid_CharMap_Handle FT_Err_Invalid_CharMap_Handle
+#define T1_Err_Invalid_Glyph_Index FT_Err_Invalid_Glyph_Index
-#define T1_Err_Unimplemented_Feature FT_Err_Unimplemented_Feature
+#define T1_Err_Unimplemented_Feature FT_Err_Unimplemented_Feature
-#define T1_Err_Invalid_Engine FT_Err_Invalid_Driver_Handle
+#define T1_Err_Invalid_Engine FT_Err_Invalid_Driver_Handle
-/* ------------- internal errors ------------ */
+ /* ------------- internal errors ------------ */
-#define T1_Err_Out_Of_Memory FT_Err_Out_Of_Memory
-#define T1_Err_Unlisted_Object FT_Err_Unlisted_Object
+#define T1_Err_Out_Of_Memory FT_Err_Out_Of_Memory
+#define T1_Err_Unlisted_Object FT_Err_Unlisted_Object
-/* ------------ general glyph outline errors ------ */
+ /* ------------ general glyph outline errors ------ */
-#define T1_Err_Invalid_Composite FT_Err_Invalid_Composite
+#define T1_Err_Invalid_Composite FT_Err_Invalid_Composite
-#define T1_Err_Syntax_Error FT_Err_Invalid_File_Format
-#define T1_Err_Stack_Underflow FT_Err_Invalid_File_Format
-#define T1_Err_Stack_Overflow FT_Err_Invalid_File_Format
+#define T1_Err_Syntax_Error FT_Err_Invalid_File_Format
+#define T1_Err_Stack_Underflow FT_Err_Invalid_File_Format
+#define T1_Err_Stack_Overflow FT_Err_Invalid_File_Format
-#endif /* TDERRORS_H */
+
+#endif /* T1ERRORS_H */
/* END */
--- a/include/freetype/internal/t1types.h
+++ b/include/freetype/internal/t1types.h
@@ -1,72 +1,76 @@
-/*******************************************************************
- *
- * t1types.h 1.0
- *
- * Basic Type1/Type2 type definitions and interface.
- *
- * This code is shared by the Type1 and Type2 drivers
- *
- *
- * Copyright 1996-2000 by
- * David Turner, Robert Wilhelm, and Werner Lemberg.
- *
- * This file is part of the FreeType project, and may only be used
- * modified and distributed under the terms of the FreeType project
- * license, LICENSE.TXT. By continuing to use, modify, or distribute
- * this file you indicate that you have read the license and
- * understand and accept it fully.
- *
- ******************************************************************/
+/***************************************************************************/
+/* */
+/* t1types.h */
+/* */
+/* Basic Type1/Type2 type definitions and interface (specification */
+/* only). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
#ifndef T1TYPES_H
#define T1TYPES_H
+
#include <freetype/t1tables.h>
#include <freetype/internal/psnames.h>
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*** ***/
+ /*** ***/
+ /*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
+ /*** ***/
+ /*** ***/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
-/*************************************************************************/
-/*************************************************************************/
-/*************************************************************************/
-/*** ***/
-/*** ***/
-/*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
-/*** ***/
-/*** ***/
-/*************************************************************************/
-/*************************************************************************/
-/*************************************************************************/
- /***********************************************************************/
- /* */
- /* <Struct> T1_Encoding */
- /* */
- /* <Description> */
- /* A structure modeling a custom encoding */
- /* */
- /* <Fields> */
- /* num_chars :: number of char codes in encoding. Usually 256 */
- /* code_first :: lower char code in encoding */
- /* code_last :: higher char code in encoding */
- /* */
- /* char_code :: array of character codes */
- /* char_index :: array of correpsonding glyph indices */
- /* char_name :: array of correpsonding glyph names */
- /* */
- typedef struct T1_Encoding_
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* T1_Encoding */
+ /* */
+ /* <Description> */
+ /* A structure modeling a custom encoding */
+ /* */
+ /* <Fields> */
+ /* num_chars :: The number of character codes in the encoding. */
+ /* Usually 256. */
+ /* */
+ /* code_first :: The lowest valid character code in the encoding. */
+ /* */
+ /* code_last :: The highest valid character code in the encoding. */
+ /* */
+ /* char_index :: An array of corresponding glyph indices. */
+ /* */
+ /* char_name :: An array of corresponding glyph names. */
+ /* */
+ typedef struct T1_Encoding_
{
- FT_Int num_chars;
- FT_Int code_first;
- FT_Int code_last;
+ FT_Int num_chars;
+ FT_Int code_first;
+ FT_Int code_last;
- FT_UShort* char_index;
- FT_String** char_name;
+ FT_UShort* char_index;
+ FT_String** char_name;
} T1_Encoding;
- typedef enum T1_EncodingType_
+ typedef enum T1_EncodingType_
{
t1_encoding_none = 0,
t1_encoding_array,
@@ -76,46 +80,46 @@
} T1_EncodingType;
- typedef struct T1_Font_
+ typedef struct T1_Font_
{
- /* font info dictionary */
- T1_FontInfo font_info;
+ /* font info dictionary */
+ T1_FontInfo font_info;
- /* private dictionary */
- T1_Private private_dict;
+ /* private dictionary */
+ T1_Private private_dict;
- /* top-level dictionary */
- FT_String* font_name;
+ /* top-level dictionary */
+ FT_String* font_name;
T1_EncodingType encoding_type;
T1_Encoding encoding;
- FT_Byte* subrs_block;
- FT_Byte* charstrings_block;
- FT_Byte* glyph_names_block;
+ FT_Byte* subrs_block;
+ FT_Byte* charstrings_block;
+ FT_Byte* glyph_names_block;
- FT_Int num_subrs;
- FT_Byte** subrs;
- FT_Int* subrs_len;
+ FT_Int num_subrs;
+ FT_Byte** subrs;
+ FT_Int* subrs_len;
- FT_Int num_glyphs;
- FT_String** glyph_names; /* array of glyph names */
- FT_Byte** charstrings; /* array of glyph charstrings */
- FT_Int* charstrings_len;
+ FT_Int num_glyphs;
+ FT_String** glyph_names; /* array of glyph names */
+ FT_Byte** charstrings; /* array of glyph charstrings */
+ FT_Int* charstrings_len;
- FT_Byte paint_type;
- FT_Byte font_type;
- FT_Matrix font_matrix;
- FT_BBox font_bbox;
- FT_Long font_id;
+ FT_Byte paint_type;
+ FT_Byte font_type;
+ FT_Matrix font_matrix;
+ FT_BBox font_bbox;
+ FT_Long font_id;
- FT_Int stroke_width;
+ FT_Int stroke_width;
} T1_Font;
- typedef struct CID_Subrs_
+ typedef struct CID_Subrs_
{
FT_UInt num_subrs;
FT_Byte** code;
@@ -123,65 +127,57 @@
} CID_Subrs;
-/*************************************************************************/
-/*************************************************************************/
-/*************************************************************************/
-/*** ***/
-/*** ***/
-/*** ORIGINAL T1_FACE CLASS DEFINITION ***/
-/*** ***/
-/*** ***/
-/*************************************************************************/
-/*************************************************************************/
-/*************************************************************************/
-/*** ***/
-/*** ***/
-/*** This structure/class is defined here because it is common ***/
-/*** to the following formats : TTF, OpenType-TT and OpenType-CFF ***/
-/*** ***/
-/*** Note however that the classes TT_Size, TT_GlyphSlot and ***/
-/*** TT_CharMap are not shared between font drivers, and are ***/
-/*** thus defined normally in "drivers/truetype/ttobjs.h" ***/
-/*** ***/
-/*** ***/
-/*************************************************************************/
-/*************************************************************************/
-/*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*** ***/
+ /*** ***/
+ /*** ORIGINAL T1_FACE CLASS DEFINITION ***/
+ /*** ***/
+ /*** ***/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* This structure/class is defined here because it is common to the */
+ /* following formats: TTF, OpenType-TT, and OpenType-CFF. */
+ /* */
+ /* Note, however, that the classes TT_Size, TT_GlyphSlot, and TT_CharMap */
+ /* are not shared between font drivers, and are thus defined normally in */
+ /* `ttobjs.h'. */
+ /* */
+ /*************************************************************************/
+
typedef struct T1_FaceRec_* T1_Face;
typedef struct CID_FaceRec_* CID_Face;
- /***************************************************/
- /* */
- /* T1_Face : */
- /* */
- /* Type1 face record.. */
- /* */
- typedef struct T1_FaceRec_
+ typedef struct T1_FaceRec_
{
- FT_FaceRec root;
- T1_Font type1;
- void* psnames;
- void* afm_data;
- FT_CharMapRec charmaprecs[2];
- FT_CharMap charmaps[2];
- PS_Unicodes unicode_map;
+ FT_FaceRec root;
+ T1_Font type1;
+ void* psnames;
+ void* afm_data;
+ FT_CharMapRec charmaprecs[2];
+ FT_CharMap charmaps[2];
+ PS_Unicodes unicode_map;
- /* support for multiple masters */
- T1_Blend* blend;
+ /* support for Multiple Masters fonts */
+ T1_Blend* blend;
} T1_FaceRec;
- typedef struct CID_FaceRec_
+ typedef struct CID_FaceRec_
{
- FT_FaceRec root;
- void* psnames;
- CID_Info cid;
- void* afm_data;
- CID_Subrs* subrs;
+ FT_FaceRec root;
+ void* psnames;
+ CID_Info cid;
+ void* afm_data;
+ CID_Subrs* subrs;
} CID_FaceRec;
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -350,8 +350,7 @@
/* TT_Load_Any */
/* */
/* <Description> */
- /* Loads any font table into client memory. Used by the */
- /* TT_Get_Font_Data() API function. */
+ /* Loads any font table into client memory. */
/* */
/* <Input> */
/* face :: The face object to look for. */