File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6060 fontSize = this . internal . getFontSize ( ) ;
6161 fontStyle = this . internal . getFont ( ) . fontStyle ;
6262
63- var px2pt = 1.545454545454545454545454 ,
63+ // 1 pixel = 0.264583 mm and 1 mm = 72/25.4 point
64+ var px2pt = 0.264583 * 72 / 25.4 ,
6465 dimensions ,
6566 text ;
6667
6768 text = document . createElement ( 'font' ) ;
6869 text . id = "jsPDFCell" ;
69- // error text.style = "font-family: ' + fontName + ';font-size:' + fontSize + 'pt;font-style: ' + fontStyle + ';";
70+ text . style . fontStyle = fontStyle ;
71+ text . style . fontName = fontName ;
72+ text . style . fontSize = fontSize + 'pt' ;
7073 text . innerText = txt ;
7174
7275 document . body . appendChild ( text ) ;
7376
74- dimensions = { w : text . offsetWidth / px2pt , h : text . offsetHeight / px2pt } ;
77+ dimensions = { w : ( text . offsetWidth + 1 ) * px2pt , h : ( text . offsetHeight + 1 ) * px2pt } ;
7578
7679 document . body . removeChild ( text ) ;
7780
You can’t perform that action at this time.
0 commit comments