diff options
-rw-r--r-- | Resource/Init/pdf_font.ps | 92 |
1 files changed, 50 insertions, 42 deletions
diff --git a/Resource/Init/pdf_font.ps b/Resource/Init/pdf_font.ps index 3f304849e..683446662 100644 --- a/Resource/Init/pdf_font.ps +++ b/Resource/Init/pdf_font.ps | |||
@@ -985,48 +985,62 @@ setglobal | |||
985 | .dicttomark readonly def | 985 | .dicttomark readonly def |
986 | 986 | ||
987 | % When Type 1 font reading procedure is executing, a copy of this dictionary is current. | 987 | % When Type 1 font reading procedure is executing, a copy of this dictionary is current. |
988 | % We have to do something special about embedded fonts that execute definefont | 988 | % topFontDict allows us to *attempt* to handle the case where a Type 1 font definition |
989 | % more than once -- that is the function of topFontDict. | 989 | % does not start by creating it's own dictionary (i.e. a number of the keys end up in |
990 | % the currentdict rather than the font dictionary). | ||
990 | % The whole type1 stream can be executed directly. There's no need to process | 991 | % The whole type1 stream can be executed directly. There's no need to process |
991 | % Length1, 2, 3 keys. | 992 | % Length1, 2, 3 keys. |
992 | 993 | ||
993 | /readtype1dict 10 dict dup begin | 994 | /readtype1dict 10 dict dup begin |
994 | /definefont { | 995 | /prev_definefont /definefont load def |
995 | exch pop | ||
996 | 996 | ||
997 | /topFontDict where { | 997 | /definefont { |
998 | { /FontType % in PLRM order | 998 | % if a font defines any keys outside it's own dictionary, |
999 | /FontMatrix | 999 | % this attempts to cope by copying them into the font dictionary |
1000 | /FontName | 1000 | [ |
1001 | /FontInfo | 1001 | /FontType % in PLRM order |
1002 | /WMode | 1002 | /FontMatrix |
1003 | /Encoding | 1003 | /FontName |
1004 | /FontBBox | 1004 | /FontInfo |
1005 | /UniqueID | 1005 | /WMode |
1006 | /XUID | 1006 | /Encoding |
1007 | /PaintType | 1007 | /FontBBox |
1008 | /StrokeWidth | 1008 | /UniqueID |
1009 | /Metrics | 1009 | /XUID |
1010 | /Metrics2 | 1010 | /PaintType |
1011 | /CDevProc | 1011 | /StrokeWidth |
1012 | /CharStrings | 1012 | /Metrics |
1013 | /Private | 1013 | /Metrics2 |
1014 | /WeightVector | 1014 | /CDevProc |
1015 | } { | 1015 | /CharStrings |
1016 | 2 copy .knownget { | 1016 | /Private |
1017 | % Stack: font topFontDict /key val | 1017 | /WeightVector |
1018 | 3 index 3 1 roll put | 1018 | ] |
1019 | { | ||
1020 | 2 copy known | ||
1021 | {pop} | ||
1022 | { | ||
1023 | dup where | ||
1024 | { | ||
1025 | 1 index get | ||
1026 | 2 index | ||
1027 | 3 1 roll put | ||
1019 | dup /MisplacedKey 0 put | 1028 | dup /MisplacedKey 0 put |
1020 | } { | 1029 | } |
1021 | pop | 1030 | {pop} ifelse |
1022 | } ifelse | 1031 | } ifelse |
1023 | } forall | 1032 | } forall |
1024 | /MisplacedKey known { | 1033 | dup /MisplacedKey known { |
1025 | ( **** Warning: Type 1 font defines some of the keys in the external scope.\n) | 1034 | ( **** Warning: Type 1 font defines some required keys outside the font dictionary.\n) |
1026 | pdfformatwarning | 1035 | pdfformatwarning |
1027 | } if | ||
1028 | } if | 1036 | } if |
1029 | 1037 | ||
1038 | dup /CharStrings get /.notdef known not { | ||
1039 | dup /CharStrings get | ||
1040 | /.notdef <9E35CED7FFD3622F09> put | ||
1041 | ( **** Warning: Type 1 font has no /.notdef entry in /CharString dictionary.\n) | ||
1042 | pdfformatwarning | ||
1043 | } if | ||
1030 | dup /UniqueID .knownget { | 1044 | dup /UniqueID .knownget { |
1031 | dup dup 0 lt exch 16#ffffff gt or { | 1045 | dup dup 0 lt exch 16#ffffff gt or { |
1032 | ( **** Warning: Ignoring invalid /UniqueID = ) exch =string cvs | 1046 | ( **** Warning: Ignoring invalid /UniqueID = ) exch =string cvs |
@@ -1036,17 +1050,11 @@ setglobal | |||
1036 | pop | 1050 | pop |
1037 | } ifelse | 1051 | } ifelse |
1038 | } if | 1052 | } if |
1039 | dup /CharStrings get /.notdef known not { | 1053 | prev_definefont |
1040 | dup /CharStrings get | ||
1041 | /.notdef <9E35CED7FFD3622F09> put | ||
1042 | ( **** Warning: Type 1 font has no /.notdef entry in /CharString dictionary.\n) | ||
1043 | pdfformatwarning | ||
1044 | } if | ||
1045 | .completefont | ||
1046 | } bdef | 1054 | } bdef |
1047 | 1055 | ||
1048 | /undef_proc_warning { | 1056 | /undef_proc_warning { |
1049 | /Repaired //true store % flag that we have warnings | 1057 | /Repaired //true store % flag that we have warnings |
1050 | UndefProcList exch 2 copy .knownget { 1 add } { 1 } ifelse put | 1058 | UndefProcList exch 2 copy .knownget { 1 add } { 1 } ifelse put |
1051 | } bdef | 1059 | } bdef |
1052 | 1060 | ||