Commit 7f4dec79 authored by smontagu%netscape.com's avatar smontagu%netscape.com
Browse files

More fine-grained NS_FONT_DEBUG environment variables to distinguish between...

More fine-grained NS_FONT_DEBUG environment variables to distinguish between Xlib, Xprint and GTK. Bug 206017, author=Roland.Mainz@informatik.med.uni-giessen.de, r=rbs, sr=dmose, a=asa.
parent 989e5fa9
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -850,11 +850,18 @@ static nsresult
InitGlobals(nsIDeviceContext *aDevice)
{
#ifdef NS_FONT_DEBUG
  char* debug = PR_GetEnv("NS_FONT_DEBUG");
  /* First check gfx/src/gtk/-specific env var "NS_FONT_DEBUG_GTK",
   * then the more general "NS_FONT_DEBUG" if "NS_FONT_DEBUG_GTK"
   * is not present */
  const char *debug = PR_GetEnv("NS_FONT_DEBUG_GTK");
  if (!debug) {
    debug = PR_GetEnv("NS_FONT_DEBUG");
  }
  
  if (debug) {
    PR_sscanf(debug, "%lX", &gFontDebug);
  }
#endif
#endif /* NS_FONT_DEBUG */

  NS_ENSURE_TRUE(nsnull != aDevice, NS_ERROR_NULL_POINTER);

+19 −1
Original line number Diff line number Diff line
@@ -1146,7 +1146,25 @@ nsFontMetricsXlibContext::Init(nsIDeviceContext *aDevice, PRBool aPrintermode)
  PR_LOG(FontMetricsXlibLM, PR_LOG_DEBUG, ("## CopyFontCharSetMapXlib done.\n"));

#ifdef NS_FONT_DEBUG
  const char* debug = PR_GetEnv("NS_FONT_DEBUG");
  /* First check gfx/src/xlib/-specific env var "NS_FONT_DEBUG_XLIB" (or
  * "NS_FONT_DEBUG_XPRINT" if the device is a printer),
   * then the more general "NS_FONT_DEBUG" if 
   * "NS_FONT_DEBUG_XLIB"/"NS_FONT_DEBUG_XPRINT" is not present */
  const char *debug;
#ifdef USE_XPRINT
  if (mPrinterMode) {
    debug = PR_GetEnv("NS_FONT_DEBUG_XPRINT");
  }
  else
#endif /* USE_XPRINT */
  {
    debug = PR_GetEnv("NS_FONT_DEBUG_XLIB");
  }

  if (!debug) {
    debug = PR_GetEnv("NS_FONT_DEBUG");
  }
  
  if (debug) {
    PR_sscanf(debug, "%lX", &gFontDebug);
  }