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

Implements vertical writing

This commit is contained in:
vyv03354 2013-02-08 21:29:22 +09:00
parent 4247339d28
commit c5b8ee6a91
9 changed files with 112 additions and 29 deletions

View file

@ -139,16 +139,16 @@ var bidi = PDFJS.bidi = (function bidiClosure() {
}
}
function BidiResult(str, isLTR) {
function BidiResult(str, isLTR, vertical) {
this.str = str;
this.ltr = isLTR;
this.dir = vertical ? 'ttb' : isLTR ? 'ltr' : 'rtl';
}
function bidi(str, startLevel) {
function bidi(str, startLevel, vertical) {
var isLTR = true;
var strLength = str.length;
if (strLength === 0)
return new BidiResult(str, isLTR);
if (strLength === 0 || vertical)
return new BidiResult(str, isLTR, vertical);
// get types, fill arrays