title: How to calculate width and height of text in jspdf?
body: <p>I'm facing some issues while creating tables in <a href="https://github.com/MrRio/jsPDF" rel="noreferrer">jspdf</a>. I could not find any good related docs, but if anyone knows one, please share.</p>
  
  <p>I found two related methods:</p>
  
  <p>1) <code>doc.getStringUnitWidth(text, {widths:12,kerning:2});</code></p>
  
  <p>2) <code>doc.getTextDimensions(text)</code></p>
  
  <p>What does <em>widths</em> and <em>kerning</em> mean in the first method? What should I provide? Which method should I use to get the width and height of text?</p>
  
  <p>My goal is to solve some issues related to overlapping cell content, wrapping of text and text overflow relative to the page width.</p>