I stumbled upon this, using the following:
Code:
on Me:*:JOIN:#:{ 

  ;I surrounded the window's font in in quotes, so it could be used in a /drawtext event
  var %f = $qt($window(#).font)
  var %s = 50
  var %i = $qt($scriptdirNBGtmp.bmp)
  var %w = $width(#,%f,%s)
  var %h = $height(#,%f,%s)
  var %c = $rgb( [ $regsubex($rgb($color(background)),/(\d+)/g,$abs($calc((255 - \t) /2))) ] )

  window -Bfhp +d @NBGTmp 0 0 %w %h
  drawtext -r @NBGTmp %c %f %s 0 0 #
  drawsave @NBGTmp %i
  background -p # %i
  close -@ @NBGTmp
  .remove %i
}




It seems quite inconsistent that font handling commands such as /font and /drawtext accept quotes (and require them for multi-worded font names), though font handling identifers such as $width()/$height() do not. It's these types of small inconsistencies that make debugging simple scripts like the above more challenging than it should be.

Last edited by FroggieDaFrog; 09/12/11 05:23 AM.