mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Fix up bidi algorithm, and set direction of div to match text direction
This commit is contained in:
parent
ffa0e082a4
commit
2bc708305d
3 changed files with 290 additions and 214 deletions
|
@ -824,18 +824,15 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
text.str += shownText.str;
|
||||
}
|
||||
text.canvasWidth += shownText.canvasWidth;
|
||||
text.length += e.length;
|
||||
text.length += shownText.length;
|
||||
}
|
||||
} else {
|
||||
malformed('TJ array element ' + e + ' is not string or num');
|
||||
}
|
||||
}
|
||||
|
||||
if (textSelection) {
|
||||
if (isRTLRangeFor(text.str.charCodeAt(0))) //first char is rtl
|
||||
text.str = bidi(null, text.str, 1);
|
||||
if (textSelection)
|
||||
this.textLayer.appendText(text, font.loadedName, fontSize);
|
||||
}
|
||||
},
|
||||
nextLineShowText: function canvasGraphicsNextLineShowText(text) {
|
||||
this.nextLine();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue