|
|
|
@ -731,11 +731,12 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
@@ -731,11 +731,12 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|
|
|
|
var arr = args[0]; |
|
|
|
|
var combinedGlyphs = []; |
|
|
|
|
var arrLength = arr.length; |
|
|
|
|
var state = stateManager.state; |
|
|
|
|
for (i = 0; i < arrLength; ++i) { |
|
|
|
|
var arrItem = arr[i]; |
|
|
|
|
if (isString(arrItem)) { |
|
|
|
|
Array.prototype.push.apply(combinedGlyphs, |
|
|
|
|
self.handleText(arrItem, stateManager.state)); |
|
|
|
|
self.handleText(arrItem, state)); |
|
|
|
|
} else if (isNum(arrItem)) { |
|
|
|
|
combinedGlyphs.push(arrItem); |
|
|
|
|
} |
|
|
|
@ -1131,17 +1132,26 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
@@ -1131,17 +1132,26 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|
|
|
|
if (typeof items[j] === 'string') { |
|
|
|
|
buildTextGeometry(items[j], textChunk); |
|
|
|
|
} else { |
|
|
|
|
var val = items[j] / 1000; |
|
|
|
|
if (!textState.font.vertical) { |
|
|
|
|
offset = -val * textState.fontSize * textState.textHScale * |
|
|
|
|
textState.textMatrix[0]; |
|
|
|
|
textState.translateTextMatrix(offset, 0); |
|
|
|
|
textChunk.width += offset; |
|
|
|
|
} else { |
|
|
|
|
offset = -val * textState.fontSize * |
|
|
|
|
textState.textMatrix[3]; |
|
|
|
|
// PDF Specification 5.3.2 states:
|
|
|
|
|
// The number is expressed in thousandths of a unit of text
|
|
|
|
|
// space.
|
|
|
|
|
// This amount is subtracted from the current horizontal or
|
|
|
|
|
// vertical coordinate, depending on the writing mode.
|
|
|
|
|
// In the default coordinate system, a positive adjustment
|
|
|
|
|
// has the effect of moving the next glyph painted either to
|
|
|
|
|
// the left or down by the given amount.
|
|
|
|
|
var val = items[j] * textState.fontSize / 1000; |
|
|
|
|
if (textState.font.vertical) { |
|
|
|
|
offset = val * textState.textMatrix[3]; |
|
|
|
|
textState.translateTextMatrix(0, offset); |
|
|
|
|
// Value needs to be added to height to paint down.
|
|
|
|
|
textChunk.height += offset; |
|
|
|
|
} else { |
|
|
|
|
offset = val * textState.textHScale * |
|
|
|
|
textState.textMatrix[0]; |
|
|
|
|
textState.translateTextMatrix(offset, 0); |
|
|
|
|
// Value needs to be subtracted from width to paint left.
|
|
|
|
|
textChunk.width -= offset; |
|
|
|
|
} |
|
|
|
|
if (items[j] < 0 && textState.font.spaceWidth > 0) { |
|
|
|
|
var fakeSpaces = -items[j] / textState.font.spaceWidth; |
|
|
|
|