summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlgs/Resource/Init/pdf_font.ps
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlgs/Resource/Init/pdf_font.ps')
-rw-r--r--Master/tlpkg/tlgs/Resource/Init/pdf_font.ps44
1 files changed, 36 insertions, 8 deletions
diff --git a/Master/tlpkg/tlgs/Resource/Init/pdf_font.ps b/Master/tlpkg/tlgs/Resource/Init/pdf_font.ps
index feaf0d036ac..bea9ea95ad1 100644
--- a/Master/tlpkg/tlgs/Resource/Init/pdf_font.ps
+++ b/Master/tlpkg/tlgs/Resource/Init/pdf_font.ps
@@ -718,7 +718,7 @@ currentdict end readonly def
{pop pop pop}
ifelse
-} bind executeonly def
+} bind executeonly odef
currentdict /.DoToUnicode? .forceundef
@@ -1179,8 +1179,16 @@ currentdict /eexec_pdf_param_dict .undef
/CharProcs 1 index /CharProcs oget def
1 index /Widths knownoget {
/Widths exch def
- /FirstChar 1 index /FirstChar oget def
- /LastChar 1 index /LastChar oget def
+ 1 index /FirstChar known 2 index /LastChar known and {
+ /FirstChar 1 index /FirstChar oget def
+ /LastChar 1 index /LastChar oget def
+ } {
+ ( **** Error: Requireed entry FirstChar or LastChar is missing from Font.\n)
+ pdfformaterror
+ ( Output may be incorrect.\n) pdfformaterror
+ /FirstChar 0 def
+ /LastChar Widths length def
+ }ifelse
} if
/FontName 1 index /Name knownoget not { /PDFType3Untitled } if def
/Encoding .notdefEncoding 2 index getencoding def
@@ -1241,7 +1249,7 @@ currentdict /eexec_pdf_param_dict .undef
} bdef
dup currentdict Encoding .processToUnicode
currentdict end .completefont exch pop
-} bind executeonly def
+} bind executeonly odef
/.adjustcharwidth { % <wx> <wy> .adjustcharwidth <wx'> <wy'>
% Enforce the metrics, in glyph space, to the values found in the PDF Font object
% - force wy == 0 (assumed, and not stored in the PDF font)
@@ -1475,6 +1483,16 @@ currentdict end readonly def
//CMap_read_dict begin
/CIDInit /ProcSet findresource begin
12 dict begin
+ /o.endmapvalue /.endmapvalue load def
+ /.endmapvalue
+ {
+ dup 65535 gt
+ {
+ ( **** Warning: CMap: CID out of valid range (0-65535).\n) pdfformatwarning
+ pop 65535
+ } if
+ o.endmapvalue
+ } bind def
4 2 roll
dup //null eq { pop } { /WMode exch def } ifelse
dup //null eq { pop } { /CIDSystemInfo exch def } ifelse
@@ -1482,6 +1500,7 @@ currentdict end readonly def
/.last_CMap_def currentdict def % establish binding
mark exch % emulate 'begincodespacerange'
0 (endcmap) /SubFileDecode filter cvx /begincmap cvx exch 2 .execn
+ currentdict /o.endmapvalue undef
endcmap
/.last_CMap_def load
{ currentdict end //CMap_read_dict eq { exit } if } loop
@@ -1849,8 +1868,16 @@ currentdict /CMap_read_dict undef
/findCIDFont {
{
dup /CIDFont resourcestatus {
- pop pop /CIDFont findresource
- exit
+ pop %size
+ % Check status. If its 1 then we loaded this CIDFont resource from disk, and
+ % its safe to use it. If its 0 then it was loaded from the PDF file and its
+ % *not* safe to use as a replacement for a missing font. If its 2 then its
+ % not loaded, but is available from external resource and is safe to use. So
+ % if status is 0, *don't* use this CIDFont.
+ 0 eq not {
+ /CIDFont findresource
+ exit
+ }if
} if
.remove_font_name_prefix
dup dup length string cvs
@@ -2026,7 +2053,7 @@ currentdict /CMap_read_dict undef
} if
/findresource cvx /undefined signalerror
} loop
-} bind executeonly def
+} bind executeonly odef
/buildCIDType0 { % <CIDFontType0-font-resource> buildCIDType0 <font>
dup /BaseFont get findCIDFont exch pop
@@ -2211,7 +2238,7 @@ currentdict /CMap_read_dict undef
/Type0 //buildType0
/Type1 //buildType1
/MMType1 //buildType1
- /Type3 //buildType3
+ /Type3 /buildType3 load
/TrueType //buildTrueType
/CIDFontType0 //buildCIDType0
/CIDFontType2 //buildCIDType2
@@ -2521,6 +2548,7 @@ drawopdict begin
pop pop pop pop
//d0 exec
} {
+ currentcolor currentcolorspace .swapcolors setcolorspace setcolor .swapcolors
6 -2 roll .adjustcharwidth 6 2 roll setcachedevice
} ifelse
} bind executeonly def