code: private static Box  parseViewBox(String val) throws SVGParseException
     {
        TextScanner scan = new TextScanner(val);
        scan.skipWhitespace();
  
        float minX = scan.nextFloat();
        scan.skipCommaWhitespace();
        float minY = scan.nextFloat();
        scan.skipCommaWhitespace();
        float width = scan.nextFloat();
        scan.skipCommaWhitespace();
        float height = scan.nextFloat();
  
        if (Float.isNaN(minX) || Float.isNaN(minY) || Float.isNaN(width) || Float.isNaN(height))
           throw new SVGParseException("Invalid viewBox definition - should have four numbers");
        if (width < 0)
           throw new SVGParseException("Invalid viewBox. width cannot be negative");
        if (height < 0)
           throw new SVGParseException("Invalid viewBox. height cannot be negative");
  
        return new SVG.Box(minX, minY, width, height);
     }
docs: /*
  Parse a viewBox attribute.