Ensure text for labels is fully within bounds by shifting it. Added methods for finding max label widths and heights (currently only two of these methods are used and return values are just an approximation).