mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Add a comment for using unit-per-em in the measureText() method
This commit is contained in:
parent
0ea9411f69
commit
a89e7331f4
1 changed files with 3 additions and 1 deletions
4
fonts.js
4
fonts.js
|
@ -155,7 +155,9 @@ var FontMeasure = (function FontMeasure() {
|
|||
var charWidth = parseFloat(font.encoding[charcode].width);
|
||||
width += charWidth;
|
||||
}
|
||||
width = width * size / 1000;
|
||||
// XXX should use the unit-per-em value from the embedded font
|
||||
var unitsPerEm = 1000;
|
||||
width = width * size / unitsPerEm;
|
||||
} catch(e) {
|
||||
width = ctx.measureText(text).width / kScalePrecision;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue