forked from minhngoc25a/freetype2
Improve tracing.
* src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c (PCF_Face_Done): Remove tracing message. * src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c (cid_face_init), src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c (sfnt_init_face), src/truetype/ttobjs.c (tt_face_init), src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add `greeting' message. * src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c (T42_Open_Face): Improve tracing.
This commit is contained in:
parent
3630bf7eb5
commit
70cf8c5e6d
18
ChangeLog
18
ChangeLog
|
@ -1,3 +1,21 @@
|
||||||
|
2011-11-26 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
Improve tracing.
|
||||||
|
|
||||||
|
* src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c
|
||||||
|
(PCF_Face_Done): Remove tracing message.
|
||||||
|
|
||||||
|
* src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c
|
||||||
|
(cff_face_init), src/cid/cidobjs.c (cid_face_init),
|
||||||
|
src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c
|
||||||
|
(sfnt_init_face), src/truetype/ttobjs.c (tt_face_init),
|
||||||
|
src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c
|
||||||
|
(T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add
|
||||||
|
`greeting' message.
|
||||||
|
|
||||||
|
* src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c
|
||||||
|
(T42_Open_Face): Improve tracing.
|
||||||
|
|
||||||
2011-11-26 Werner Lemberg <wl@gnu.org>
|
2011-11-26 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
[cid] Fix error code.
|
[cid] Fix error code.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
FreeType font driver for bdf files
|
FreeType font driver for bdf files
|
||||||
|
|
||||||
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by
|
Copyright (C) 2001-2008, 2011 by
|
||||||
Francesco Zappa Nardelli
|
Francesco Zappa Nardelli
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
@ -332,8 +332,6 @@ THE SOFTWARE.
|
||||||
FT_FREE( bdfface->available_sizes );
|
FT_FREE( bdfface->available_sizes );
|
||||||
|
|
||||||
FT_FREE( face->bdffont );
|
FT_FREE( face->bdffont );
|
||||||
|
|
||||||
FT_TRACE4(( "BDF_Face_Done: done face\n" ));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -356,6 +354,8 @@ THE SOFTWARE.
|
||||||
FT_UNUSED( face_index );
|
FT_UNUSED( face_index );
|
||||||
|
|
||||||
|
|
||||||
|
FT_TRACE2(( "BDF driver\n" ));
|
||||||
|
|
||||||
if ( FT_STREAM_SEEK( 0 ) )
|
if ( FT_STREAM_SEEK( 0 ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ THE SOFTWARE.
|
||||||
error = bdf_load_font( stream, memory, &options, &font );
|
error = bdf_load_font( stream, memory, &options, &font );
|
||||||
if ( error == BDF_Err_Missing_Startfont_Field )
|
if ( error == BDF_Err_Missing_Startfont_Field )
|
||||||
{
|
{
|
||||||
FT_TRACE2(( "[not a valid BDF file]\n" ));
|
FT_TRACE2(( " not a BDF file\n" ));
|
||||||
goto Fail;
|
goto Fail;
|
||||||
}
|
}
|
||||||
else if ( error )
|
else if ( error )
|
||||||
|
@ -379,10 +379,10 @@ THE SOFTWARE.
|
||||||
bdf_property_t* prop = NULL;
|
bdf_property_t* prop = NULL;
|
||||||
|
|
||||||
|
|
||||||
FT_TRACE4(( "number of glyphs: %d (%d)\n",
|
FT_TRACE4(( " number of glyphs: allocated %d (used %d)\n",
|
||||||
font->glyphs_size,
|
font->glyphs_size,
|
||||||
font->glyphs_used ));
|
font->glyphs_used ));
|
||||||
FT_TRACE4(( "number of unencoded glyphs: %d (%d)\n",
|
FT_TRACE4(( " number of unencoded glyphs: allocated %d (used %d)\n",
|
||||||
font->unencoded_size,
|
font->unencoded_size,
|
||||||
font->unencoded_used ));
|
font->unencoded_used ));
|
||||||
|
|
||||||
|
@ -490,7 +490,8 @@ THE SOFTWARE.
|
||||||
if ( n < FT_UINT_MAX )
|
if ( n < FT_UINT_MAX )
|
||||||
face->default_glyph = (FT_UInt)n;
|
face->default_glyph = (FT_UInt)n;
|
||||||
else
|
else
|
||||||
FT_TRACE1(( "idx %d is too large for this system\n", n ));
|
FT_TRACE1(( "BDF_Face_Init:"
|
||||||
|
" idx %d is too large for this system\n", n ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -761,8 +762,8 @@ THE SOFTWARE.
|
||||||
case BDF_INTEGER:
|
case BDF_INTEGER:
|
||||||
if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )
|
if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )
|
||||||
{
|
{
|
||||||
FT_TRACE1(( "bdf_get_bdf_property: " ));
|
FT_TRACE1(( "bdf_get_bdf_property:"
|
||||||
FT_TRACE1(( "too large integer 0x%x is truncated\n" ));
|
" too large integer 0x%x is truncated\n" ));
|
||||||
}
|
}
|
||||||
aproperty->type = BDF_PROPERTY_TYPE_INTEGER;
|
aproperty->type = BDF_PROPERTY_TYPE_INTEGER;
|
||||||
aproperty->u.integer = (FT_Int32)prop->value.l;
|
aproperty->u.integer = (FT_Int32)prop->value.l;
|
||||||
|
@ -771,8 +772,8 @@ THE SOFTWARE.
|
||||||
case BDF_CARDINAL:
|
case BDF_CARDINAL:
|
||||||
if ( prop->value.ul > 0xFFFFFFFFUL )
|
if ( prop->value.ul > 0xFFFFFFFFUL )
|
||||||
{
|
{
|
||||||
FT_TRACE1(( "bdf_get_bdf_property: " ));
|
FT_TRACE1(( "bdf_get_bdf_property:"
|
||||||
FT_TRACE1(( "too large cardinal 0x%x is truncated\n" ));
|
" too large cardinal 0x%x is truncated\n" ));
|
||||||
}
|
}
|
||||||
aproperty->type = BDF_PROPERTY_TYPE_CARDINAL;
|
aproperty->type = BDF_PROPERTY_TYPE_CARDINAL;
|
||||||
aproperty->u.cardinal = (FT_UInt32)prop->value.ul;
|
aproperty->u.cardinal = (FT_UInt32)prop->value.ul;
|
||||||
|
|
|
@ -1458,7 +1458,7 @@
|
||||||
font->header_size < 4 ||
|
font->header_size < 4 ||
|
||||||
font->absolute_offsize > 4 )
|
font->absolute_offsize > 4 )
|
||||||
{
|
{
|
||||||
FT_TRACE2(( "[not a CFF font header]\n" ));
|
FT_TRACE2(( " not a CFF font header\n" ));
|
||||||
error = CFF_Err_Unknown_File_Format;
|
error = CFF_Err_Unknown_File_Format;
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -505,6 +505,8 @@
|
||||||
pshinter = (PSHinter_Service)FT_Get_Module_Interface(
|
pshinter = (PSHinter_Service)FT_Get_Module_Interface(
|
||||||
library, "pshinter" );
|
library, "pshinter" );
|
||||||
|
|
||||||
|
FT_TRACE2(( "CFF driver\n" ));
|
||||||
|
|
||||||
/* create input stream from resource */
|
/* create input stream from resource */
|
||||||
if ( FT_STREAM_SEEK( 0 ) )
|
if ( FT_STREAM_SEEK( 0 ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
@ -515,7 +517,7 @@
|
||||||
{
|
{
|
||||||
if ( face->format_tag != TTAG_OTTO ) /* `OTTO'; OpenType/CFF font */
|
if ( face->format_tag != TTAG_OTTO ) /* `OTTO'; OpenType/CFF font */
|
||||||
{
|
{
|
||||||
FT_TRACE2(( "[not a valid OpenType/CFF font]\n" ));
|
FT_TRACE2(( " not an OpenType/CFF font\n" ));
|
||||||
error = CFF_Err_Unknown_File_Format;
|
error = CFF_Err_Unknown_File_Format;
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,6 +318,8 @@
|
||||||
face->pshinter = pshinter;
|
face->pshinter = pshinter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FT_TRACE2(( "CID driver\n" ));
|
||||||
|
|
||||||
/* open the tokenizer; this will also check the font format */
|
/* open the tokenizer; this will also check the font format */
|
||||||
if ( FT_STREAM_SEEK( 0 ) )
|
if ( FT_STREAM_SEEK( 0 ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
if ( ft_strncmp( (char *)stream->cursor,
|
if ( ft_strncmp( (char *)stream->cursor,
|
||||||
"%!PS-Adobe-3.0 Resource-CIDFont", 31 ) )
|
"%!PS-Adobe-3.0 Resource-CIDFont", 31 ) )
|
||||||
{
|
{
|
||||||
FT_TRACE2(( "[not a valid CID-keyed font]\n" ));
|
FT_TRACE2(( " not a CID-keyed font\n" ));
|
||||||
error = CID_Err_Unknown_File_Format;
|
error = CID_Err_Unknown_File_Format;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
FreeType font driver for pcf files
|
FreeType font driver for pcf files
|
||||||
|
|
||||||
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009,
|
Copyright (C) 2000-2004, 2006-2011 by
|
||||||
2010 by
|
|
||||||
Francesco Zappa Nardelli
|
Francesco Zappa Nardelli
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
@ -248,8 +247,6 @@ THE SOFTWARE.
|
||||||
FT_FREE( face->charset_encoding );
|
FT_FREE( face->charset_encoding );
|
||||||
FT_FREE( face->charset_registry );
|
FT_FREE( face->charset_registry );
|
||||||
|
|
||||||
FT_TRACE4(( "PCF_Face_Done: done face\n" ));
|
|
||||||
|
|
||||||
/* close compressed stream if any */
|
/* close compressed stream if any */
|
||||||
if ( pcfface->stream == &face->comp_stream )
|
if ( pcfface->stream == &face->comp_stream )
|
||||||
{
|
{
|
||||||
|
@ -274,6 +271,8 @@ THE SOFTWARE.
|
||||||
FT_UNUSED( face_index );
|
FT_UNUSED( face_index );
|
||||||
|
|
||||||
|
|
||||||
|
FT_TRACE2(( "PCF driver\n" ));
|
||||||
|
|
||||||
error = pcf_load_font( stream, face );
|
error = pcf_load_font( stream, face );
|
||||||
if ( error )
|
if ( error )
|
||||||
{
|
{
|
||||||
|
@ -405,7 +404,7 @@ THE SOFTWARE.
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
FT_TRACE2(( "[not a valid PCF file]\n" ));
|
FT_TRACE2(( " not a PCF file\n" ));
|
||||||
PCF_Face_Done( pcfface );
|
PCF_Face_Done( pcfface );
|
||||||
error = PCF_Err_Unknown_File_Format; /* error */
|
error = PCF_Err_Unknown_File_Format; /* error */
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* FreeType PFR object methods (body). */
|
/* FreeType PFR object methods (body). */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
|
/* Copyright 2002-2008, 2010-2011 by */
|
||||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
|
@ -77,6 +77,8 @@
|
||||||
FT_UNUSED( params );
|
FT_UNUSED( params );
|
||||||
|
|
||||||
|
|
||||||
|
FT_TRACE2(( "PFR driver\n" ));
|
||||||
|
|
||||||
/* load the header and check it */
|
/* load the header and check it */
|
||||||
error = pfr_header_load( &face->header, stream );
|
error = pfr_header_load( &face->header, stream );
|
||||||
if ( error )
|
if ( error )
|
||||||
|
@ -84,7 +86,7 @@
|
||||||
|
|
||||||
if ( !pfr_header_check( &face->header ) )
|
if ( !pfr_header_check( &face->header ) )
|
||||||
{
|
{
|
||||||
FT_TRACE4(( "pfr_face_init: not a valid PFR font\n" ));
|
FT_TRACE2(( " not a PFR font\n" ));
|
||||||
error = PFR_Err_Unknown_File_Format;
|
error = PFR_Err_Unknown_File_Format;
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -376,7 +376,10 @@
|
||||||
tag != TTAG_true &&
|
tag != TTAG_true &&
|
||||||
tag != TTAG_typ1 &&
|
tag != TTAG_typ1 &&
|
||||||
tag != 0x00020000UL )
|
tag != 0x00020000UL )
|
||||||
|
{
|
||||||
|
FT_TRACE2(( " not a font using the SFNT container format\n" ));
|
||||||
return SFNT_Err_Unknown_File_Format;
|
return SFNT_Err_Unknown_File_Format;
|
||||||
|
}
|
||||||
|
|
||||||
face->ttc_header.tag = TTAG_ttcf;
|
face->ttc_header.tag = TTAG_ttcf;
|
||||||
|
|
||||||
|
@ -463,6 +466,8 @@
|
||||||
|
|
||||||
FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS );
|
FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS );
|
||||||
|
|
||||||
|
FT_TRACE2(( "SFNT driver\n" ));
|
||||||
|
|
||||||
error = sfnt_open_font( stream, face );
|
error = sfnt_open_font( stream, face );
|
||||||
if ( error )
|
if ( error )
|
||||||
return error;
|
return error;
|
||||||
|
|
|
@ -493,6 +493,8 @@
|
||||||
TT_Face face = (TT_Face)ttface;
|
TT_Face face = (TT_Face)ttface;
|
||||||
|
|
||||||
|
|
||||||
|
FT_TRACE2(( "TTF driver\n" ));
|
||||||
|
|
||||||
library = ttface->driver->root.library;
|
library = ttface->driver->root.library;
|
||||||
|
|
||||||
sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" );
|
sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" );
|
||||||
|
@ -519,7 +521,7 @@
|
||||||
face->format_tag != 0x00020000L && /* CJK fonts for Win 3.1 */
|
face->format_tag != 0x00020000L && /* CJK fonts for Win 3.1 */
|
||||||
face->format_tag != TTAG_true ) /* Mac fonts */
|
face->format_tag != TTAG_true ) /* Mac fonts */
|
||||||
{
|
{
|
||||||
FT_TRACE2(( "[not a valid TTF font]\n" ));
|
FT_TRACE2(( " not a TTF font\n" ));
|
||||||
goto Bad_Format;
|
goto Bad_Format;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -323,6 +323,8 @@
|
||||||
face->pshinter = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
|
face->pshinter = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
|
||||||
"pshinter" );
|
"pshinter" );
|
||||||
|
|
||||||
|
FT_TRACE2(( "Type 1 driver\n" ));
|
||||||
|
|
||||||
/* open the tokenizer; this will also check the font format */
|
/* open the tokenizer; this will also check the font format */
|
||||||
error = T1_Open_Face( face );
|
error = T1_Open_Face( face );
|
||||||
if ( error )
|
if ( error )
|
||||||
|
|
|
@ -164,7 +164,7 @@
|
||||||
error = check_type1_format( stream, "%!FontType", 10 );
|
error = check_type1_format( stream, "%!FontType", 10 );
|
||||||
if ( error )
|
if ( error )
|
||||||
{
|
{
|
||||||
FT_TRACE2(( "[not a Type1 font]\n" ));
|
FT_TRACE2(( " not a Type 1 font\n" ));
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,8 @@
|
||||||
|
|
||||||
if ( type1->font_type != 42 )
|
if ( type1->font_type != 42 )
|
||||||
{
|
{
|
||||||
|
FT_ERROR(( "T42_Open_Face: cannot handle FontType %d\n",
|
||||||
|
type1->font_type ));
|
||||||
error = T42_Err_Unknown_File_Format;
|
error = T42_Err_Unknown_File_Format;
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
@ -186,6 +188,8 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FT_TRACE2(( "Type 42 driver\n" ));
|
||||||
|
|
||||||
/* open the tokenizer, this will also check the font format */
|
/* open the tokenizer, this will also check the font format */
|
||||||
error = T42_Open_Face( face );
|
error = T42_Open_Face( face );
|
||||||
if ( error )
|
if ( error )
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* Type 42 font parser (body). */
|
/* Type 42 font parser (body). */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */
|
/* Copyright 2002-2011 by */
|
||||||
/* Roberto Alameda. */
|
/* Roberto Alameda. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* FreeType font driver for Windows FNT/FON files */
|
/* FreeType font driver for Windows FNT/FON files */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010 by */
|
/* Copyright 1996-2004, 2006-2011 by */
|
||||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||||
/* Copyright 2003 Huw D M Davies for Codeweavers */
|
/* Copyright 2003 Huw D M Davies for Codeweavers */
|
||||||
/* Copyright 2007 Dmitry Timoshkov for Codeweavers */
|
/* Copyright 2007 Dmitry Timoshkov for Codeweavers */
|
||||||
|
@ -224,7 +224,7 @@
|
||||||
if ( header->version != 0x200 &&
|
if ( header->version != 0x200 &&
|
||||||
header->version != 0x300 )
|
header->version != 0x300 )
|
||||||
{
|
{
|
||||||
FT_TRACE2(( "[not a valid FNT file]\n" ));
|
FT_TRACE2(( " not a Windows FNT file\n" ));
|
||||||
error = FNT_Err_Unknown_File_Format;
|
error = FNT_Err_Unknown_File_Format;
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@
|
||||||
|
|
||||||
if ( header->file_size < size )
|
if ( header->file_size < size )
|
||||||
{
|
{
|
||||||
FT_TRACE2(( "[not a valid FNT file]\n" ));
|
FT_TRACE2(( " not a Windows FNT file\n" ));
|
||||||
error = FNT_Err_Unknown_File_Format;
|
error = FNT_Err_Unknown_File_Format;
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
@ -696,6 +696,8 @@
|
||||||
FT_UNUSED( params );
|
FT_UNUSED( params );
|
||||||
|
|
||||||
|
|
||||||
|
FT_TRACE2(( "Windows FNT driver\n" ));
|
||||||
|
|
||||||
/* try to load font from a DLL */
|
/* try to load font from a DLL */
|
||||||
error = fnt_face_get_dll_font( face, face_index );
|
error = fnt_face_get_dll_font( face, face_index );
|
||||||
if ( !error && face_index < 0 )
|
if ( !error && face_index < 0 )
|
||||||
|
|
Loading…
Reference in New Issue