File tree Expand file tree Collapse file tree 5 files changed +21
-6
lines changed Expand file tree Collapse file tree 5 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -575,7 +575,7 @@ var CanvasGraphics = (function canvasGraphics() {
575
575
ctx .scale (1 , -1 );
576
576
ctx .translate (current .x , -1 * current .y );
577
577
ctx .transform .apply (ctx , fontMatrix );
578
- ctx .scale (1 / textHScale , 1 );
578
+ ctx .scale (textHScale , 1 );
579
579
},
580
580
getTextGeometry : function canvasGetTextGeometry () {
581
581
var geometry = {};
@@ -651,7 +651,7 @@ var CanvasGraphics = (function canvasGraphics() {
651
651
ctx .transform .apply (ctx , current .textMatrix );
652
652
ctx .translate (current .x , current .y );
653
653
654
- ctx .scale (1 / textHScale , 1 );
654
+ ctx .scale (textHScale , 1 );
655
655
for (var i = 0 ; i < glyphsLength ; ++i ) {
656
656
657
657
var glyph = glyphs [i ];
Original file line number Diff line number Diff line change @@ -1705,10 +1705,18 @@ var Font = (function Font() {
1705
1705
1706
1706
var cidToGidMap = properties .cidToGidMap || [];
1707
1707
var gidToCidMap = [0 ];
1708
- for (var j = cidToGidMap .length - 1 ; j >= 0 ; j --) {
1709
- var gid = cidToGidMap [j ];
1710
- if (gid )
1711
- gidToCidMap [gid ] = j ;
1708
+ if (cidToGidMap .length > 0 ) {
1709
+ for (var j = cidToGidMap .length - 1 ; j >= 0 ; j --) {
1710
+ var gid = cidToGidMap [j ];
1711
+ if (gid )
1712
+ gidToCidMap [gid ] = j ;
1713
+ }
1714
+ // filling the gaps using CID above the CIDs currently used in font
1715
+ var nextCid = cidToGidMap .length ;
1716
+ for (var i = 1 ; i < numGlyphs ; i ++) {
1717
+ if (!gidToCidMap [i ])
1718
+ gidToCidMap [i ] = nextCid ++;
1719
+ }
1712
1720
}
1713
1721
1714
1722
var glyphs = [], ids = [];
Original file line number Diff line number Diff line change 16
16
! alphatrans.pdf
17
17
! devicen.pdf
18
18
! cmykjpeg.pdf
19
+ ! issue840.pdf
Original file line number Diff line number Diff line change 290
290
"link" : true ,
291
291
"rounds" : 1 ,
292
292
"type" : " eq"
293
+ },
294
+ { "id" : " issue840" ,
295
+ "file" : " pdfs/issue840.pdf" ,
296
+ "md5" : " 20d88011dd7e3c4fb5274979094dab93" ,
297
+ "rounds" : 1 ,
298
+ "type" : " eq"
293
299
}
294
300
]
You can’t perform that action at this time.
0 commit comments