Formatting.
This commit is contained in:
parent
e97cb9127d
commit
05c21b8f3d
|
@ -80,7 +80,7 @@
|
|||
|
||||
|
||||
|
||||
/* Quick 'n' Dirty Pascal string to C string converter.
|
||||
/* Quick'n'dirty Pascal string to C string converter.
|
||||
Warning: this call is not thread safe! Use with caution. */
|
||||
static
|
||||
char* p2c_str( unsigned char* pstr )
|
||||
|
@ -96,7 +96,8 @@
|
|||
|
||||
/* Given a pathname, fill in a file spec. */
|
||||
static
|
||||
int file_spec_from_path( const char* pathname, FSSpec *spec )
|
||||
int file_spec_from_path( const char* pathname,
|
||||
FSSpec* spec )
|
||||
{
|
||||
Str255 p_path;
|
||||
FT_ULong path_len;
|
||||
|
@ -125,13 +126,15 @@
|
|||
|
||||
if ( FSpGetFInfo( spec, &finfo ) != noErr )
|
||||
return 0; /* file might not exist */
|
||||
|
||||
return finfo.fdType;
|
||||
}
|
||||
|
||||
|
||||
/* Given a PostScript font name, create the Macintosh LWFN file name. */
|
||||
static
|
||||
void create_lwfn_name( char* ps_name, Str255 lwfn_file_name )
|
||||
void create_lwfn_name( char* ps_name,
|
||||
Str255 lwfn_file_name )
|
||||
{
|
||||
int max = 5, count = 0;
|
||||
FT_Byte* p = lwfn_file_name;
|
||||
|
@ -170,12 +173,12 @@
|
|||
FCBPBRec pb;
|
||||
OSErr error;
|
||||
|
||||
|
||||
pb.ioNamePtr = file_name;
|
||||
pb.ioVRefNum = 0;
|
||||
pb.ioRefNum = ref_num;
|
||||
pb.ioFCBIndx = 0;
|
||||
|
||||
|
||||
error = PBGetFCBInfoSync( &pb );
|
||||
if ( error == noErr )
|
||||
{
|
||||
|
@ -200,9 +203,11 @@
|
|||
|
||||
|
||||
ref_num = HomeResFile( fond );
|
||||
|
||||
error = ResError();
|
||||
if ( !error )
|
||||
error = get_file_location( ref_num, &v_ref_num, &dir_id, fond_file_name );
|
||||
error = get_file_location( ref_num, &v_ref_num,
|
||||
&dir_id, fond_file_name );
|
||||
if ( !error )
|
||||
error = FSMakeFSSpec( v_ref_num, dir_id, file_name, spec );
|
||||
|
||||
|
@ -245,6 +250,7 @@
|
|||
unsigned char* names[64];
|
||||
int i;
|
||||
|
||||
|
||||
p += fond->ffStylOff;
|
||||
style = (StyleTable*)p;
|
||||
p += sizeof ( StyleTable );
|
||||
|
@ -262,6 +268,8 @@
|
|||
if ( style->indexes[0] > 1 )
|
||||
{
|
||||
unsigned char* suffixes = names[style->indexes[0] - 1];
|
||||
|
||||
|
||||
for ( i=1; i<=suffixes[0]; i++ )
|
||||
strcat( ps_name, p2c_str( names[suffixes[i] - 1 ] ) );
|
||||
}
|
||||
|
@ -299,6 +307,7 @@
|
|||
the output buffer. */
|
||||
res_id = 501;
|
||||
last_code = -1;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
post_data = Get1Resource( 'POST', res_id++ );
|
||||
|
@ -323,7 +332,7 @@
|
|||
goto Error;
|
||||
|
||||
/* Second pass: append all POST data to the buffer, add PFB fields.
|
||||
Glue all consequtive chunks of the same type together. */
|
||||
Glue all consecutive chunks of the same type together. */
|
||||
p = buffer;
|
||||
res_id = 501;
|
||||
last_code = -1;
|
||||
|
@ -390,6 +399,7 @@ Error:
|
|||
|
||||
|
||||
FREE( stream->base );
|
||||
|
||||
stream->size = 0;
|
||||
stream->base = 0;
|
||||
stream->close = 0;
|
||||
|
@ -467,6 +477,7 @@ Error:
|
|||
args.flags = args.flags | ft_open_driver;
|
||||
args.driver = FT_Get_Module( library, driver_name );
|
||||
}
|
||||
|
||||
error = FT_Open_Face( library, &args, face_index, aface );
|
||||
if ( error == FT_Err_Ok )
|
||||
(*aface)->face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM;
|
||||
|
@ -501,6 +512,7 @@ Error:
|
|||
FILE* f;
|
||||
char* path;
|
||||
|
||||
|
||||
path = p2c_str( spec->name );
|
||||
strcat( path, ".PFB" );
|
||||
f = fopen( path, "wb" );
|
||||
|
@ -616,8 +628,8 @@ Error:
|
|||
/* <Input> */
|
||||
/* fond :: An FOND resource. */
|
||||
/* */
|
||||
/* face_index :: only supported for the -1 `sanity check' */
|
||||
/* special case. */
|
||||
/* face_index :: Only supported for the -1 `sanity check' special */
|
||||
/* case. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aface :: A handle to a new face object. */
|
||||
|
@ -628,11 +640,11 @@ Error:
|
|||
/* <Notes> */
|
||||
/* This function can be used to create FT_Face abjects from fonts */
|
||||
/* that are installed in the system like so: */
|
||||
/* */
|
||||
/* fond = GetResource( 'FOND', fontName ); */
|
||||
/* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
|
||||
/* */
|
||||
FT_EXPORT_FUNC( FT_Error ) FT_New_Face_From_FOND(
|
||||
FT_Library library,
|
||||
FT_EXPORT_FUNC( FT_Error ) FT_New_Face_From_FOND( FT_Library library,
|
||||
Handle fond,
|
||||
FT_Long face_index,
|
||||
FT_Face* aface )
|
||||
|
@ -684,9 +696,9 @@ Error:
|
|||
/* */
|
||||
/* <Description> */
|
||||
/* This is the Mac-specific implementation of FT_New_Face. In */
|
||||
/* addition to the standard FT_New_Face functionality, it also */
|
||||
/* addition to the standard FT_New_Face() functionality, it also */
|
||||
/* accepts pathnames to Mac suitcase files. For further */
|
||||
/* documentation see the original FT_New_Face in ftobjs.c. */
|
||||
/* documentation see the original FT_New_Face() in ftobjs.c. */
|
||||
/* */
|
||||
FT_EXPORT_FUNC( FT_Error ) FT_New_Face( FT_Library library,
|
||||
const char* pathname,
|
||||
|
@ -719,3 +731,5 @@ Error:
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -1235,8 +1235,9 @@
|
|||
}
|
||||
|
||||
|
||||
/* There's a Mac-specific extended implementation of FT_New_Face()
|
||||
in src/mac/ftmac.c */
|
||||
/* there's a Mac-specific extended implementation of FT_New_Face() */
|
||||
/* in src/mac/ftmac.c */
|
||||
|
||||
#ifndef macintosh
|
||||
|
||||
/*************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue