Documente Academic
Documente Profesional
Documente Cultură
/begincmap {
mark
} def
/endcmap {
% Stack: mark code_lo1 code_hi1 cid1 ...
20 dict begin
/depth counttomark 3 sub def
% Do a first pass to determine the maximum CID.
0 0 3 depth {
1 add /d exch def
d index d 2 add index 1 get add d 3 add index 1 get sub .max
} for
1 add /ncid exch def
/map ncid 2 mul string def
% Now fill in the map.
0 3 depth {
/d exch def
d index 2 mul /cid2 exch def
d 1 add index /hi exch def
d 2 add index 2 string copy /lo exch def
lo 1 get 1 hi 1 get {
map cid2 lo 0 get put
map cid2 1 add 3 -1 roll put
/cid2 cid2 2 add def
} for
} for
% Print the map.
(%stdout) (w) file
dup (<) print
dup /ASCIIHexEncode filter
dup map writestring
closefile
() = flush
closefile
end
} def
%/begincodespacerange
/endcodespacerange {cleartomark} def
%/usecmap
%/beginbfchar
/endbfchar {cleartomark} def
%/beginbfrange
/endbfrange {cleartomark} def
%/begincidchar
/endcidchar {
counttomark 2 idiv { dup counttomark 1 add 3 roll } repeat pop
} def
%/begincidrange
/endcidrange {
counttomark 1 add -1 roll pop
} def
%/beginnotdefchar
/endnotdefchar {cleartomark} def
%/beginnotdefrange
/endnotdefrange {cleartomark} def
/.cmap2code { % - .cmap2code -
/CIDInit /ProcSet findresource dup length dict copy
.cmap2codedict { 3 copy put pop pop } forall
/CIDInit exch /ProcSet defineresource pop
} def