Minor logging improvements to freetype.c

Huw D M Davies h.davies1 at physics.ox.ac.uk
Tue Jun 1 05:42:56 CDT 2004


On Mon, May 31, 2004 at 09:47:35PM +0100, Mike Hearn wrote:
> Mike Hearn <mh at codeweavers.com>
> Change some TRACEs into WARNs, WARN on skipping font due to wrong format.
> 
> Index: dlls/gdi/freetype.c
> ===================================================================
> RCS file: /home/wine/wine/dlls/gdi/freetype.c,v
> retrieving revision 1.60
> diff -u -r1.60 freetype.c
> --- dlls/gdi/freetype.c	20 Apr 2004 01:12:18 -0000	1.60
> +++ dlls/gdi/freetype.c	31 May 2004 20:47:29 -0000
> @@ -316,20 +316,21 @@
>  	}
>  
>  	if(!FT_IS_SFNT(ft_face)) { /* for now we'll skip everything but TT/OT */
> +            WARN("skipping font file %s, not TrueType/OpenType font\n", debugstr_a(file));
>  	    pFT_Done_Face(ft_face);
>  	    return FALSE;
>  	}
>  	if(!pFT_Get_Sfnt_Table(ft_face, ft_sfnt_os2) ||
>  	   !pFT_Get_Sfnt_Table(ft_face, ft_sfnt_hhea) ||
>             !(pHeader = pFT_Get_Sfnt_Table(ft_face, ft_sfnt_head))) {
> -	    TRACE("Font file %s lacks either an OS2, HHEA or HEAD table.\n"
> +	    WARN("Font file %s lacks either an OS2, HHEA or HEAD table.\n"
>  		  "Skipping this font.\n", debugstr_a(file));
>  	    pFT_Done_Face(ft_face);
>  	    return FALSE;
>  	}
>  
>          if(!ft_face->family_name || !ft_face->style_name) {
> -            TRACE("Font file %s lacks either a family or style name\n", debugstr_a(file));
> +            WARN("Font file %s lacks either a family or style name\n", debugstr_a(file));
>              pFT_Done_Face(ft_face);
>              return FALSE;
>          }


You could argue that these three should really be FIXMEs

> @@ -369,13 +370,13 @@
>                        (*insertface)->font_version,  pHeader->Font_Revision);
>  
>                  if(fake_family) {
> -                    TRACE("This font is a replacement but the original really exists, so we'll skip the replacement\n");
> +                    WARN("This font is a replacement but the original really exists, so we'll skip the replacement\n");
>                      HeapFree(GetProcessHeap(), 0, StyleW);
>                      pFT_Done_Face(ft_face);
>                      return FALSE;
>                  }
>                  if(pHeader->Font_Revision <= (*insertface)->font_version) {
> -                    TRACE("Original font is newer so skipping this one\n");
> +                    WARN("Original font is newer so skipping this one\n");
>                      HeapFree(GetProcessHeap(), 0, StyleW);
>                      pFT_Done_Face(ft_face);
>                      return FALSE;
> 

I don't think these two should be warnings.  It's perfectly possible
to have two copies of the same font installed and you don't want to
confuse users by issuing warnings about something where we actually do
the right thing.

Huw.
-- 
Huw Davies
huw at codeweavers.com



More information about the wine-devel mailing list