summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Cherepanov <alex.cherepanov@artifex.com>2012-04-24 15:06:16 -0400
committerAlex Cherepanov <alex.cherepanov@artifex.com>2012-04-24 15:10:30 -0400
commit430e9e345c84912f953161aa843b37f235c97708 (patch)
tree9164184ffe551c69b19cc8a9af18e782af33df0b
parentb5d2134b8ebea14594411580776f1bce5c40363c (diff)
Bug 693000: Verify /Subtype of CIDFont resource.
Check whether CIDFont resource refers to a Type 1 file and process it accordingly.
-rw-r--r--gs/Resource/Init/pdf_font.ps24
1 files changed, 17 insertions, 7 deletions
diff --git a/gs/Resource/Init/pdf_font.ps b/gs/Resource/Init/pdf_font.ps
index c47e80593..95030c51f 100644
--- a/gs/Resource/Init/pdf_font.ps
+++ b/gs/Resource/Init/pdf_font.ps
@@ -1786,17 +1786,27 @@ currentdict /CMap_read_dict undef
% Adjust a CIDFontType0 DW[2] in the font resource.
/adjustCIDType0 { % <font-resource> <font> adjustfont <font'>
- addCIDmetrics
- dup /CIDFontName get exch /CIDFont defineresource
+ dup /FontType get 1 eq {
+ ( **** Warning: Font resource has a wrong /Subtype.\n) pdfformaterror
+ adjustfont
+ } {
+ addCIDmetrics
+ dup /CIDFontName get exch /CIDFont defineresource
+ } ifelse
} bind def
% Adjust a CIDFontType2 DW[2] and CIDToGIDMap in the font resource.
/adjustCIDType2 { % <font-resource> <font> adjustfont <font'>
- addCIDmetrics
- dup /CIDFontType get 2 eq { % OpenType CFF font converts to CIDFontType 0
- processCIDToGIDMap % that ignores CIDMap.
- } if
- dup /CIDFontName get exch /CIDFont defineresource
+ dup /FontType get 1 eq {
+ ( **** Warning: Font resource has a wrong /Subtype.\n) pdfformaterror
+ adjustfont
+ } {
+ addCIDmetrics
+ dup /CIDFontType get 2 eq { % OpenType CFF font converts to CIDFontType 0
+ processCIDToGIDMap % that ignores CIDMap.
+ } if
+ dup /CIDFontName get exch /CIDFont defineresource
+ } ifelse
} bind def
% ---------------- Other embedded fonts ---------------- %