1
0
Fork 0
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:
Vivien Nicolas 2011-09-09 14:26:24 +02:00
parent 0ea9411f69
commit a89e7331f4

View file

@ -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;
}