Formatting.

This commit is contained in:
Werner Lemberg 2003-09-17 05:26:33 +00:00
parent 104dd41d96
commit 013efd1410
14 changed files with 115 additions and 74 deletions

View File

@ -125,7 +125,6 @@ FT_BEGIN_HEADER
(*TT_Done_Face_Func)( TT_Face face );
/*************************************************************************/
/* */
/* <FuncType> */
@ -453,7 +452,6 @@ FT_BEGIN_HEADER
(*TT_Free_Table_Func)( TT_Face face );
/*************************************************************************/
/* */
/* <Struct> */

View File

@ -38,11 +38,13 @@
{
FT_Service_BDF service;
FT_FACE_FIND_SERVICE( service, face, FT_SERVICE_ID_BDF );
if ( service && service->get_charset_id )
error = service->get_charset_id( face, &encoding, &registry );
}
if ( acharset_encoding )
*acharset_encoding = encoding;
@ -69,11 +71,13 @@
{
FT_Service_BDF service;
FT_FACE_FIND_SERVICE( service, face, FT_SERVICE_ID_BDF );
if ( service && service->get_property )
error = service->get_property( face, prop_name, aproperty );
}
return error;
}

View File

@ -4,7 +4,7 @@
/* */
/* Multiple Master font support (body). */
/* */
/* Copyright 1996-2001 by */
/* Copyright 1996-2001, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -31,12 +31,14 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_mm
static FT_Error
ft_face_get_mm_service( FT_Face face,
FT_Service_MultiMasters *aservice )
{
FT_Error error;
*aservice = NULL;
if ( !face )
@ -50,6 +52,7 @@
multi_masters,
FT_SERVICE_ID_MULTI_MASTERS );
}
return error;
}
@ -63,6 +66,7 @@
FT_Error error;
FT_Service_MultiMasters service;
error = ft_face_get_mm_service( face, &service );
if ( !error )
{
@ -85,6 +89,7 @@
FT_Error error;
FT_Service_MultiMasters service;
error = ft_face_get_mm_service( face, &service );
if ( !error )
{
@ -92,6 +97,7 @@
if ( service->set_mm_design )
error = service->set_mm_design( face, num_coords, coords );
}
return error;
}
@ -106,6 +112,7 @@
FT_Error error;
FT_Service_MultiMasters service;
error = ft_face_get_mm_service( face, &service );
if ( !error )
{
@ -113,7 +120,9 @@
if ( service->set_mm_blend )
error = service->set_mm_blend( face, num_coords, coords );
}
return error;
}
/* END */

View File

@ -31,6 +31,7 @@
#include FT_SERVICE_POSTSCRIPT_NAME_H
#include FT_SERVICE_GLYPH_DICT_H
FT_BASE_DEF( FT_Pointer )
ft_service_list_lookup( FT_ServiceDesc service_descriptors,
const char* service_id )
@ -38,6 +39,7 @@
FT_Pointer result = NULL;
FT_ServiceDesc desc = service_descriptors;
if ( desc && service_id )
{
for ( ; desc->serv_id != NULL; desc++ )
@ -49,9 +51,11 @@
}
}
}
return result;
}
FT_BASE_DEF( void )
ft_validator_init( FT_Validator valid,
const FT_Byte* base,
@ -2394,11 +2398,15 @@
{
FT_Service_GlyphDict service;
#if 0
FT_FACE_LOOKUP_SERVICE( face, service,
glyph_dict,
FT_SERVICE_ID_GLYPH_DICT );
#else
service = face->internal->services.glyph_dict;
if ( service == FT_SERVICE_UNAVAILABLE )
service = NULL;
@ -2406,19 +2414,22 @@
{
FT_Module module = FT_MODULE( face->driver );
if ( module->clazz->get_interface )
service = module->clazz->get_interface( module,
FT_SERVICE_ID_GLYPH_DICT );
face->internal->services . glyph_dict = service != NULL
? service
face->internal->services.glyph_dict =
service != NULL ? service
: FT_SERVICE_UNAVAILABLE;
}
#endif
#endif /* 1 */
if ( service && service->name_index )
result = service->name_index( face, glyph_name );
}
return result;
}
@ -2444,15 +2455,14 @@
{
FT_Service_GlyphDict service;
FT_FACE_LOOKUP_SERVICE( face, service,
glyph_dict,
FT_SERVICE_ID_GLYPH_DICT );
if ( service && service->get_name )
{
error = service->get_name( face, glyph_index, buffer, buffer_max );
}
}
return error;
}
@ -2473,6 +2483,7 @@
{
FT_Service_PsName service;
FT_FACE_LOOKUP_SERVICE( face, service,
postscript_name,
FT_SERVICE_ID_POSTSCRIPT_NAME );
@ -2480,6 +2491,7 @@
if ( service && service->get_ps_name )
result = service->get_ps_name( face );
}
Exit:
return result;
}
@ -2494,6 +2506,7 @@
void* table = 0;
FT_Service_SFNT_Table service;
if ( face && FT_IS_SFNT( face ) )
{
FT_FACE_FIND_SERVICE( face, service, FT_SERVICE_ID_SFNT_TABLE );

View File

@ -340,6 +340,7 @@
{ NULL, NULL }
};
static FT_Module_Interface
cff_get_interface( CFF_Driver driver,
const char* module_interface )

View File

@ -55,11 +55,13 @@
return result;
}
static const FT_Service_PsNameRec cid_service_ps_name =
{
(FT_PsName_GetFunc) cid_get_postscript_name
};
/*
* SERVICE LIST
*
@ -72,6 +74,7 @@
{ NULL, NULL }
};
static FT_Module_Interface
cid_get_interface( FT_Driver driver,
const FT_String* cid_interface )

View File

@ -510,6 +510,7 @@ THE SOFTWARE.
return PCF_Err_Invalid_Argument;
}
static FT_Service_BDFRec pcf_service_bdf =
{
(FT_BDF_GetCharsetIdFunc)NULL, /* unimplemented ? */

View File

@ -609,9 +609,10 @@
}
/* the kerning data embedded in a PFR font are (charcode,charcode)
* pairs, we need to translate them to (gindex,gindex) and sort
* the resulting array
/*
* The kerning data embedded in a PFR font are (charcode,charcode)
* pairs; we need to translate them to (gindex,gindex) and sort
* the resulting array.
*/
static FT_UInt
pfr_get_gindex( PFR_Char chars,
@ -621,11 +622,13 @@
FT_UInt min = 0;
FT_UInt max = count;
while ( min < max )
{
FT_UInt mid = ( min + max ) >> 1;
PFR_Char c = chars + mid;
if ( c->char_code == charcode )
return mid + 1;
@ -645,6 +648,7 @@
FT_UInt32 p1 = PFR_KERN_PAIR_INDEX( (PFR_KernPair)pair1 );
FT_UInt32 p2 = PFR_KERN_PAIR_INDEX( (PFR_KernPair)pair2 );
if ( p1 < p2 )
return -1;
if ( p1 > p2 )
@ -665,6 +669,7 @@
FT_UInt num_chars = phy_font->num_chars;
FT_UInt count;
/* create kerning pairs array
*/
if ( FT_NEW_ARRAY( phy_font->kern_pairs, phy_font->num_kern_pairs ) )
@ -682,6 +687,7 @@
FT_UInt limit = count + item->pair_count;
FT_Byte* p;
if ( limit > phy_font->num_kern_pairs )
{
error = PFR_Err_Invalid_Table;
@ -700,6 +706,7 @@
FT_UInt char1, char2;
FT_Int kerning;
if ( item->flags & PFR_KERN_2BYTE_CHAR )
{
char1 = FT_NEXT_USHORT( p );

View File

@ -425,6 +425,7 @@
FT_UNUSED( error ); /* just needed as syntactical sugar */
kerning->x = 0;
kerning->y = 0;
@ -437,6 +438,7 @@
PFR_KernPair pair = pairs + mid;
FT_UInt32 pidx = PFR_KERN_PAIR_INDEX( pair );
if ( pidx == idx )
{
kerning->x = pair->kerning;

View File

@ -125,6 +125,7 @@
#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
/*
* POSTSCRIPT NAME SERVICE
*

View File

@ -359,6 +359,7 @@
FT_Module sfntd;
SFNT_Service sfnt;
result = ft_service_list_lookup( tt_services, tt_interface );
if ( result != NULL )
return result;

View File

@ -142,6 +142,7 @@
{ NULL, NULL }
};
static FT_Module_Interface
T42_Get_Interface( FT_Driver driver,
const FT_String* t42_interface )