def get_max_width(char): max_width = 0 for byte in char: trimmed = np.trim_zeros(byte, 'b') max_width = max(len(trimmed), max_width) return max_width