Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 133842 | Differences between
and this patch

Collapse All | Expand All

(-)espgs-8.15.1_p20060430.orig/lib/gs_ttf.ps (-30 / +85 lines)
Lines 261-266 Link Here
261
  } for pop exch pop
261
  } for pop exch pop
262
} bind def
262
} bind def
263
263
264
/.biglength { % <str>|<array of str> .biglength <integer>
265
  dup type /arraytype eq { 0 exch { length add } forall } { length } ifelse
266
} bind def
267
268
/concats { % [str ...] concats str
269
  () exch dup length 1 sub -1 0 {
270
    1 index exch get dup type /stringtype ne { dup length string cvs } if
271
    3 -1 roll exch dup length 2 index length add string
272
    dup dup 4 2 roll copy length 4 -1 roll putinterval exch
273
  } for pop
274
} bind def
275
276
% <str>|<array of str> <index> <count> .biggetinterval <str>|<array of str>
277
/.biggetinterval {
278
  3 dict begin
279
  2 index type /arraytype eq {
280
    /c exch def
281
    /i exch def
282
    [ exch {
283
      dup length /l exch def
284
      i c add l gt {
285
        i l lt {
286
          i l i sub getinterval
287
          /c i c add l sub def
288
          /i 0 def
289
        } {
290
          pop
291
          /i i l sub def
292
        } ifelse
293
      } {
294
        i c getinterval exit
295
      } ifelse
296
    } forall
297
    ] dup .biglength 65535 le { concats } if
298
  } { getinterval } ifelse
299
  end
300
} bind def
301
302
% <str>|<array of str> <index> getu16 <integer>
303
/.biggetu16 {
304
  2 .biggetinterval 0 getu16
305
} bind def
306
307
% <str>|<array of str> <index> getu32 <integer>
308
/.biggetu32 {
309
  4 .biggetinterval 0 getu32
310
} bind def
311
264
% Each procedure in this dictionary is called as follows:
312
% Each procedure in this dictionary is called as follows:
265
%       <encodingtable> proc <glypharray>
313
%       <encodingtable> proc <glypharray>
266
/cmapformats mark
314
/cmapformats mark
Lines 351-364 Link Here
351
  } bind
399
  } bind
352
  4 {		% Microsoft/Adobe segmented mapping.
400
  4 {		% Microsoft/Adobe segmented mapping.
353
    /etab exch def
401
    /etab exch def
354
    /nseg2 etab 6 getu16 def
402
    /nseg2 etab 6 .biggetu16 def
355
    14 /endc etab 2 index nseg2 getinterval def
403
    14 /endc etab 2 index nseg2 .biggetinterval def
356
		% The Apple TrueType documentation omits the 2-byte
404
		% The Apple TrueType documentation omits the 2-byte
357
		% 'reserved pad' that follows the endCount vector!
405
		% 'reserved pad' that follows the endCount vector!
358
    2 add
406
    2 add
359
    nseg2 add /startc etab 2 index nseg2 getinterval def
407
    nseg2 add /startc etab 2 index nseg2 .biggetinterval def
360
    nseg2 add /iddelta etab 2 index nseg2 getinterval def
408
    nseg2 add /iddelta etab 2 index nseg2 .biggetinterval def
361
    nseg2 add /idroff etab 2 index nseg2 getinterval def
409
    nseg2 add /idroff etab 2 index nseg2 .biggetinterval def
362
		% The following hack allows us to properly handle
410
		% The following hack allows us to properly handle
363
		% idiosyncratic fonts that start at 0xf000:
411
		% idiosyncratic fonts that start at 0xf000:
364
    pop
412
    pop
Lines 370-377 Link Here
370
    /numcodes 0 def /glyphs 0 0 2 nseg2 3 sub {
418
    /numcodes 0 def /glyphs 0 0 2 nseg2 3 sub {
371
		% Stack: /glyphs numglyphs i2
419
		% Stack: /glyphs numglyphs i2
372
      /i2 exch def
420
      /i2 exch def
373
      /scode startc i2 getu16 def
421
      /scode startc i2 .biggetu16 def
374
      /ecode endc i2 getu16 def
422
      /ecode endc i2 .biggetu16 def
375
      numcodes scode firstcode sub
423
      numcodes scode firstcode sub
376
		% Hack for fonts that have only 0x0000 and 0xf000 ranges
424
		% Hack for fonts that have only 0x0000 and 0xf000 ranges
377
      %dup 16#e000 ge { 255 and } if
425
      %dup 16#e000 ge { 255 and } if
Lines 392-399 Link Here
392
    /numcodes 0 def /code 0 def
440
    /numcodes 0 def /code 0 def
393
    0 2 nseg2 3 sub {
441
    0 2 nseg2 3 sub {
394
      /i2 exch def
442
      /i2 exch def
395
      /scode startc i2 getu16 def
443
      /scode startc i2 .biggetu16 def
396
      /ecode endc i2 getu16 def
444
      /ecode endc i2 .biggetu16 def
397
      numcodes scode firstcode sub
445
      numcodes scode firstcode sub
398
		% Hack for fonts that have only 0x0000 and 0xf000 ranges
446
		% Hack for fonts that have only 0x0000 and 0xf000 ranges
399
      %dup 16#e000 ge { 255 and } if
447
      %dup 16#e000 ge { 255 and } if
Lines 405-419 Link Here
405
	(scode=) print scode =only
453
	(scode=) print scode =only
406
	( ecode=) print ecode =only
454
	( ecode=) print ecode =only
407
	( delta=) print delta =only
455
	( delta=) print delta =only
408
	( droff=) print idroff i2 getu16 =
456
	( droff=) print idroff i2 .biggetu16 =
409
      } if
457
      } if
410
      idroff i2 getu16 dup 0 eq {
458
      idroff i2 .biggetu16 dup 0 eq {
411
	pop scode delta add 65535 and 1 ecode delta add 65535 and
459
	pop scode delta add 65535 and 1 ecode delta add 65535 and
412
	{ putglyph } for
460
	{ putglyph } for
413
      } {	% The +2 is for the 'reserved pad'.
461
      } {	% The +2 is for the 'reserved pad'.
414
        /gloff exch 14 nseg2 3 mul add 2 add i2 add add def
462
        /gloff exch 14 nseg2 3 mul add 2 add i2 add add def
415
        0 1 ecode scode sub {
463
        0 1 ecode scode sub {
416
	  2 mul gloff add etab exch getu16
464
	  2 mul gloff add etab exch .biggetu16
417
	  dup 0 ne { delta add 65535 and } if putglyph
465
	  dup 0 ne { delta add 65535 and } if putglyph
418
	} for
466
	} for
419
      } ifelse
467
      } ifelse
Lines 436-447 Link Here
436
484
437
% <cmaptab> cmaparray <glypharray>
485
% <cmaptab> cmaparray <glypharray>
438
/cmaparray {
486
/cmaparray {
439
  dup 0 getu16 cmapformats exch .knownget {
487
  dup 0 .biggetu16 cmapformats exch .knownget {
440
    TTFDEBUG {
488
    TTFDEBUG {
441
      (cmap: format ) print 1 index 0 getu16 = flush
489
      (cmap: format ) print 1 index 0 .biggetu16 = flush
442
    } if exec
490
    } if exec
443
  } {
491
  } {
444
    (Can't handle format ) print 0 getu16 = flush
492
    (Can't handle format ) print 0 .biggetu16 = flush
445
    0 1 255 { } for 256 packedarray
493
    0 1 255 { } for 256 packedarray
446
  } ifelse
494
  } ifelse
447
  TTFDEBUG {
495
  TTFDEBUG {
Lines 513-525 Link Here
513
% Adobe requirement that each sfnts entry have even length.
561
% Adobe requirement that each sfnts entry have even length.
514
/readtables mark
562
/readtables mark
515
	% Ordinary tables
563
	% Ordinary tables
516
  (cmap) { .readtable }
564
  (cmap) { .readbigtable }
517
  (head) 1 index
565
  (head) 1 index
518
  (hhea) 1 index
566
  (hhea) 1 index
519
  (maxp) 1 index
567
  (maxp) 1 index
520
  (name) 1 index
568
  (name) 1 index
521
  (OS/2) 1 index
569
  (OS/2) 1 index
522
  (post) 1 index
570
  (post) { .readbigtable }
523
  %(vhea) 1 index
571
  %(vhea) 1 index
524
  systemdict /DEVICE .knownget { (pdfwrite) ne } {true} ifelse {
572
  systemdict /DEVICE .knownget { (pdfwrite) ne } {true} ifelse {
525
  (vhea) 1 index  % better to be ignored for vertical writing in pdfwrite
573
  (vhea) 1 index  % better to be ignored for vertical writing in pdfwrite
Lines 867-876 Link Here
867
  } ifelse
915
  } ifelse
868
		% Stack: ... /FontInfo mark key1 value1 ...
916
		% Stack: ... /FontInfo mark key1 value1 ...
869
  post null ne {
917
  post null ne {
870
    /ItalicAngle post 4 gets32 65536.0 div
918
    post type /arraytype eq {
871
    /isFixedPitch post 12 getu32 0 ne
919
      % this post table is a big table. /post should be [(...) ...]
872
    /UnderlinePosition post 8 gets16 upem div
920
      % data we actually need here should be first one in array.
873
    /UnderlineThickness post 10 gets16 upem div
921
      /posttable post 1 get def
922
    } {
923
      /posttable post def
924
    } ifelse
925
    /ItalicAngle posttable 4 gets32 65536.0 div
926
    /isFixedPitch posttable 12 getu32 0 ne
927
    /UnderlinePosition posttable 8 gets16 upem div
928
    /UnderlineThickness posttable 10 gets16 upem div
874
  } if
929
  } if
875
  counttomark 0 ne { .dicttomark } { pop pop } ifelse
930
  counttomark 0 ne { .dicttomark } { pop pop } ifelse
876
  /XUID [orgXUID 42 curxuid]
931
  /XUID [orgXUID 42 curxuid]
Lines 929-950 Link Here
929
    } if
984
    } if
930
    tabdict /cmap get                                   % bool [] i PlatID SpecID (cmap)
985
    tabdict /cmap get                                   % bool [] i PlatID SpecID (cmap)
931
    dup /cmaptab exch def % temporary
986
    dup /cmaptab exch def % temporary
932
    0 1 2 index 2 getu16 1 sub {                         % bool [] i PlatID SpecID (cmap) j
987
    0 1 2 index 2 .biggetu16 1 sub {                         % bool [] i PlatID SpecID (cmap) j
933
      8 mul 4 add 1 index exch 8 getinterval             % bool [] i PlatID SpecID (cmap) (cmapsub)
988
      8 mul 4 add 1 index exch 8 .biggetinterval             % bool [] i PlatID SpecID (cmap) (cmapsub)
934
      TTFDEBUG {
989
      TTFDEBUG {
935
        (cmap: platform ) print dup 0 getu16 =only
990
        (cmap: platform ) print dup 0 .biggetu16 =only
936
        ( encoding ) print dup 2 getu16 = flush
991
        ( encoding ) print dup 2 .biggetu16 = flush
937
      } if
992
      } if
938
      dup 0 getu16 4 index eq {
993
      dup 0 .biggetu16 4 index eq {
939
        dup 2 getu16 3 index eq {                        % bool [] i PlatID SpecID (cmap) (cmapsub)
994
        dup 2 .biggetu16 3 index eq {                        % bool [] i PlatID SpecID (cmap) (cmapsub)
940
          TTFDEBUG {
995
          TTFDEBUG {
941
            (Choosen a cmap for platform=) print 3 index =only
996
            (Choosen a cmap for platform=) print 3 index =only
942
            ( encoding=) print 2 index =
997
            ( encoding=) print 2 index =
943
          } if
998
          } if
944
          /cmapsub 1 index def
999
          /cmapsub 1 index def
945
          dup 4 getu32                                   % bool [] i PlatID SpecID (cmap) (cmapsub) p
1000
          dup 4 .biggetu32                                   % bool [] i PlatID SpecID (cmap) (cmapsub) p
946
          cmaptab length 1 index sub                     % bool [] i PlatID SpecID (cmap) (cmapsub) p l
1001
          cmaptab .biglength 1 index sub                     % bool [] i PlatID SpecID (cmap) (cmapsub) p l
947
          cmaptab 3 1 roll getinterval
1002
          cmaptab 3 1 roll .biggetinterval
948
          /cmaptab exch def                              % bool [] i PlatID SpecID (cmap) (cmapsub)
1003
          /cmaptab exch def                              % bool [] i PlatID SpecID (cmap) (cmapsub)
949
          5 index 5 index 1 add get                      % bool [] i PlatID SpecID (cmap) (cmapsub) /Decoding
1004
          5 index 5 index 1 add get                      % bool [] i PlatID SpecID (cmap) (cmapsub) /Decoding
950
          /Decoding exch def                             % bool [] i PlatID SpecID (cmap) (cmapsub)
1005
          /Decoding exch def                             % bool [] i PlatID SpecID (cmap) (cmapsub)

Return to bug 133842