1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 07:08:08 +02:00

Fixes font debugger; text builder api refactoring

This commit is contained in:
Yury Delendik 2012-10-09 08:25:41 -05:00
parent 399463a450
commit b5f952a63a
3 changed files with 16 additions and 15 deletions

View file

@ -2303,17 +2303,16 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv, pageIdx) {
}
};
this.appendText = function textLayerBuilderAppendText(fontName, fontSize,
geom) {
this.appendText = function textLayerBuilderAppendText(geom) {
var textDiv = document.createElement('div');
// vScale and hScale already contain the scaling to pixel units
var fontHeight = fontSize * geom.vScale;
var fontHeight = geom.fontSize * geom.vScale;
textDiv.dataset.canvasWidth = geom.canvasWidth * geom.hScale;
textDiv.dataset.fontName = fontName;
textDiv.dataset.fontName = geom.fontName;
textDiv.style.fontSize = fontHeight + 'px';
textDiv.style.fontFamily = fontName;
textDiv.style.fontFamily = geom.fontFamily;
textDiv.style.left = geom.x + 'px';
textDiv.style.top = (geom.y - fontHeight) + 'px';