Use the canvas method to determine label size instead of using it on the label itself, since the canvas needs context.