The -p switch in /drawtext makes it process control codes. You would need to use the same option in $width().