def parse(name, value): words = fnutil.split_words(name, value, 4) return BBX( fnutil.parse_dec('width', words[0], 1, DPARSE_LIMIT), fnutil.parse_dec('height', words[1], 1, DPARSE_LIMIT), fnutil.parse_dec('bbxoff', words[2], -DPARSE_LIMIT, DPARSE_LIMIT), fnutil.parse_dec('bbyoff', words[3], -DPARSE_LIMIT, DPARSE_LIMIT))
def parse(name, value, limit): words = fnutil.split_words(name, value, 2) return Width(fnutil.parse_dec(name + '.x', words[0], -limit, limit), fnutil.parse_dec(name + '.y', words[1], -limit, limit))
def parse(name, value): words = fnutil.split_words(name, value, 4) return BBX(fnutil.parse_dec('width', words[0], 1, WIDTH_MAX), fnutil.parse_dec('height', words[1], 1, HEIGHT_MAX), fnutil.parse_dec('bbxoff', words[2], -WIDTH_MAX, WIDTH_MAX), fnutil.parse_dec('bbyoff', words[3], -WIDTH_MAX, WIDTH_MAX))
def check_size(value): words = fnutil.split_words('SIZE', value, 3) fnutil.parse_dec('point size', words[0], 1, None) fnutil.parse_dec('x resolution', words[1], 1, None) fnutil.parse_dec('y resolution', words[2], 1, None)
def _parse(name, value, limit_x, limit_y): words = fnutil.split_words(name, value, 2) return Width(fnutil.parse_dec('width x', words[0], -limit_x, limit_x), fnutil.parse_dec('width y', words[1], -limit_y, limit_y))