public static float svgToObjectBoundingBox(String s,
String attr,
short d,
Context ctx) {
try {
LengthParser lengthParser = new LengthParser();
UnitResolver ur = new UnitResolver();
lengthParser.setLengthHandler(ur);
lengthParser.parse(new StringReader(s));
return svgToObjectBoundingBox(ur.value, ur.unit, d, ctx);
} catch (ParseException ex) {
throw new BridgeException(ctx.getElement(),
ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {attr, s, ex});