Skip to content

Commit

Permalink
Merge pull request #4832 from yurydelendik/showtext
Browse files Browse the repository at this point in the history
Refactors showText: split type3, remove showSpacedText
  • Loading branch information
Snuffleupagus committed May 29, 2014
2 parents 5b16323 + d53dc2e commit 7e6cdc7
Show file tree
Hide file tree
Showing 3 changed files with 171 additions and 182 deletions.
19 changes: 16 additions & 3 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,18 +680,31 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
break;
case OPS.showSpacedText:
var arr = args[0];
var combinedGlyphs = [];
var arrLength = arr.length;
for (i = 0; i < arrLength; ++i) {
if (isString(arr[i])) {
arr[i] = self.handleText(arr[i], stateManager.state);
var arrItem = arr[i];
if (isString(arrItem)) {
Array.prototype.push.apply(combinedGlyphs,
self.handleText(arrItem, stateManager.state));
} else if (isNum(arrItem)) {
combinedGlyphs.push(arrItem);
}
}
args[0] = combinedGlyphs;
fn = OPS.showText;
break;
case OPS.nextLineShowText:
operatorList.addOp(OPS.nextLine);
args[0] = self.handleText(args[0], stateManager.state);
fn = OPS.showText;
break;
case OPS.nextLineSetSpacingShowText:
args[2] = self.handleText(args[2], stateManager.state);
operatorList.addOp(OPS.nextLine);
operatorList.addOp(OPS.setWordSpacing, [args.shift()]);
operatorList.addOp(OPS.setCharSpacing, [args.shift()]);
args[0] = self.handleText(args[0], stateManager.state);
fn = OPS.showText;
break;
case OPS.setTextRenderingMode:
stateManager.state.textRenderingMode = args[0];
Expand Down
Loading

0 comments on commit 7e6cdc7

Please sign in to comment.