title: iText 5.5.3 ColumnText doesn't wrap text correctly due to the way font size is measured
body: <h2>Question Setup</h2>
  
  <p>I am trying to accurately determine the width of a font (Ubuntu Italic), though iText appears to ignore the portion of the last glyph after the horizontal advance as shown in the image below.</p>
  
  <p><img src="https://i.stack.imgur.com/KEKoy.png" alt="ff using Ubuntu Italic Font"></p>
  
  <p>The code I used to generate this example is as follows:</p>
  
  <pre><code>Document document = new Document(PageSize.LETTER);
  FileOutputStream out = new FileOutputStream(new File("test.pdf"));
  PdfWriter writer = PdfWriter.getInstance(document, out);
  
  document.open();
  
  String text = "ff";
  Chunk chunk = new Chunk(text, FontFactory.getFont("Ubuntu-Italic.ttf", 72)
  Phrase phrase = new Phrase(chunk);
  
  float width = ColumnText.getWidth(phrase);
  System.out.println(width + ", " + chunk.getWidthPoint());
  
  PdfPTable table = new PdfPTable(1);
  table.setWidthPercentage(100);
  table.setTotalWidth(width);
  
  PdfPCell cell = table.getDefaultCell();
  cell.setPadding(0);
  cell.setUseDescender(true);
  cell.setUseAscender(true);
  table.addCell(phrase);
  
  float height = table.calculateHeights();
  
  PdfContentByte canvas = writer.getDirectContent();
  
  ColumnText columnText = new ColumnText(canvas);
  columnText.setSimpleColumn(36, 756 - height, 36 + width, 756);
  columnText.addElement(table);
  columnText.go();
  
  document.close();
  out.close();
  </code></pre>
  
  <p>As demonstrated in the code I tried both <code>ColumnText.getWidth(phrase)</code> as well as <code>chunk.getWidthPoint()</code> which both return the same value, with a little bit of floating point difference.</p>
  
  <h2>Question</h2>
  
  <p>The code I wrote above simulates a situation in iText where text doesn't wrap correctly to the next line.  The problem I'm having is that ColumnText, in the code I am using, is cropped.  The issue is that because of the way iText measures text, the ColumnText thinks there is enough room for the <code>f</code> at the right edge when in fact there really isn't, so in my situation it is getting cut off.  Is there a way to force ColumnText to measure the width of the font differently so that this doesn't happen?</p>