nl_tokens: Make an invisible canvas buffer and draw on it .
pl_tokens: function makeBuffer ( width , <mask> , drawFun ) { var canvas = makeCanvas ( width , height ) ; var ctx = canvas . getContext ( "2d" ) ; // when image smoothing is enabled, the image gets blurred and the pixel data isn't correct even when the image shouldn't be scaled which breaks NinePatch if ( platform . isEjecta ( ) ) { ctx . imageSmoothingEnabled = false ; } drawFun ( ctx ) ; return canvas ; }