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

Merge pull request #2686 from vyv03354/bug770409

Implement vertical writing
This commit is contained in:
Brendan Dahl 2013-02-25 12:47:47 -08:00
commit a13f7964b1
9 changed files with 112 additions and 29 deletions

View file

@ -2363,6 +2363,11 @@ var Font = (function FontClosure() {
// Trying to fix encoding using glyph CIDSystemInfo.
this.loadCidToUnicode(properties);
this.cidEncoding = properties.cidEncoding;
this.vertical = properties.vertical;
if (this.vertical) {
this.vmetrics = properties.vmetrics;
this.defaultVMetrics = properties.defaultVMetrics;
}
if (properties.toUnicode)
this.toUnicode = properties.toUnicode;
@ -4449,17 +4454,15 @@ var Font = (function FontClosure() {
var fontCharCode, width, operatorList, disabled;
var width = this.widths[charcode];
var vmetric = this.vmetrics && this.vmetrics[charcode];
switch (this.type) {
case 'CIDFontType0':
if (this.noUnicodeAdaptation) {
width = this.widths[this.unicodeToCID[charcode] || charcode];
}
fontCharCode = this.toFontChar[charcode] || charcode;
break;
case 'CIDFontType2':
var cid = this.unicodeToCID[charcode] || charcode;
if (this.noUnicodeAdaptation) {
width = this.widths[this.unicodeToCID[charcode] || charcode];
width = this.widths[cid];
vmetric = this.vmetrics && this.vmetrics[cid];
}
fontCharCode = this.toFontChar[charcode] || charcode;
break;
@ -4523,6 +4526,7 @@ var Font = (function FontClosure() {
fontChar: String.fromCharCode(fontCharCode),
unicode: unicodeChars,
width: width,
vmetric: vmetric,
disabled: disabled,
operatorList: operatorList
};