private static int writeBillingAddress (String address, Graphics2D g, FontRenderContext fRend, Font b, Font f, int x, int y) {
         final String tokens[] = address.split("\\s+");
         final int j = tokens.length;
         int k = 0, lineLength, n = new BigDecimal(address.length()).divide(new BigDecimal(40), 0, BigDecimal.ROUND_UP).intValue();
         
         if(n == 0)                         // avoid problems with short text
             n = 1;
         
         if(n > 3)                          // text limited to three lines
             n = 3;
         
         for(int i = 0; i < n; i++) {
             StringBuilder toWrite = new StringBuilder();
             lineLength = 0;
             while(lineLength < 41 && k < j) {
                 if(lineLength + tokens[k].length() + 1 <= 41) {
                     if(i == 0 && lineLength == 0)              // address start
                         toWrite.append("Indirizzo: ");
                     toWrite.append(tokens[k].concat(" "));     // add token
                     lineLength += tokens[k].length() + 1;
                 } else if (i == 3) {
                     toWrite.append("...");                       // address end
                     lineLength = 41;
                 } else {
                     break;
                 }
                 k++;
             }
             g.drawGlyphVector(f.createGlyphVector(fRend, toWrite.toString()), x, y + shortHeightLines(i));
         }
         return n;   
     }