From 74c2cbeecfa6ed5daa062b56be9d45c8cac596a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Gouget?= Date: Tue, 6 Nov 2001 00:46:36 +0000 Subject: [PATCH] Add traces to help diagnose systematic cached-metrics regeneration problems. --- graphics/x11drv/xfont.c | 20 ++++++++++++++++++-- objects/font.c | 3 ++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/graphics/x11drv/xfont.c b/graphics/x11drv/xfont.c index 7821bc27d29..08a2629804a 100644 --- a/graphics/x11drv/xfont.c +++ b/graphics/x11drv/xfont.c @@ -2185,9 +2185,17 @@ static BOOL XFONT_ReadCachedMetrics( int fd, int res, unsigned x_checksum, int x { if( offset > length || pfi->cptable >= (UINT16)X11DRV_CPTABLE_COUNT || - (int)(pfi->next) != j++ ) goto fail; + (int)(pfi->next) != j++ ) + { + TRACE("error: offset=%ld length=%ld cptable=%d pfi->next=%d j=%d\n",(long)offset,(long)length,pfi->cptable,(int)pfi->next,j-1); + goto fail; + } - if( pfi->df.dfPixHeight == 0 ) goto fail; + if( pfi->df.dfPixHeight == 0 ) + { + TRACE("error: dfPixHeight==0\n"); + goto fail; + } pfi->df.dfFace = pfr->lfFaceName; if( pfi->fi_flags & FI_SCALABLE ) @@ -2225,13 +2233,21 @@ static BOOL XFONT_ReadCachedMetrics( int fd, int res, unsigned x_checksum, int x lpch += len; offset += len; if (offset > length) + { + TRACE("error: offset=%ld length=%ld\n",(long)offset,(long)length); goto fail; + } } close( fd ); return TRUE; } } + } else { + TRACE("Wrong length: %ld!=%ld\n",(long)length,(long)(i+offset)); } + } else { + TRACE("Checksum (%x vs. %x) or count (%d vs. %d) mismatch\n", + u,x_checksum,i,x_count); } fail: if( fontList ) HeapFree( GetProcessHeap(), 0, fontList ); diff --git a/objects/font.c b/objects/font.c index 52c71029177..0450715df78 100644 --- a/objects/font.c +++ b/objects/font.c @@ -453,9 +453,10 @@ HFONT WINAPI CreateFontIndirectW( const LOGFONTW *plf ) { memcpy( &fontPtr->logfont, plf, sizeof(LOGFONTW) ); - TRACE("(%ld %ld %ld %ld) %s %s %s => %04x\n", + TRACE("(%ld %ld %ld %ld %x) %s %s %s => %04x\n", plf->lfHeight, plf->lfWidth, plf->lfEscapement, plf->lfOrientation, + plf->lfPitchAndFamily, debugstr_w(plf->lfFaceName), plf->lfWeight > 400 ? "Bold" : "", plf->lfItalic ? "Italic" : "", hFont);