summaryrefslogtreecommitdiff
path: root/gs/src/gdevpdti.c
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2008-03-01 10:18:20 +0000
committerKen Sharp <ken.sharp@artifex.com>2008-03-01 10:18:20 +0000
commit7cc4ef27ad3dea305ff4e1c2af586f48becfa437 (patch)
tree016fdbe94f6cdd26b9de6c79e6da2a6f8dec0edc /gs/src/gdevpdti.c
parent71b3fcc36d2dd7296d8e5f6859482e0b76e9811d (diff)
Fix (pdfwrite): problems with type 3 fonts executing 'show'.
Details: Bug #689685 "OpenType font incorrectly converted to PDF". The File is from Quark XPress and contains a type 3 font which executes a 'show' and a 'charpath stroke' with a glyph from a type 1 font. Further, it executes a 'charpath' on this type 3 glyph. Pdfwrite was unaware, when processing the 'show' that this was inside a charpath operation, and emitted the shown glyph. Modified pdfwrtite to be aware that a charpath is in operation, and to have the graphics library handle any show operations. (gdevpdfx.h) Add a new flag 'type3charpath' to the gx_device_pdf structure. (gdevpdfb.h) Add an initialiser for the type3charpath flag (also for the last_charpath_op which was missed in that change) (gdevpdtt.c) In gdev_pdf_text_begin, if type3charpath is true, go straight to the default text processing. Otherwise, check to see if this is a type 3 font, and the operation is 'charpath'. If so then create a pdfwrite text enumerator to process the text. In pdf_text_process, if we have a type 3 font, the operation is charpath and type3charpath is false, set it to true and go straight to the default text handler. When the enumerator is completed, if type3charpath is true, set it to false. In pdf_text_process, while handling text, do not start accumulating a charparoc if type3charpath is set. Finally, in pdf_text_set_cache, if type3charpath is set, simply execute the standard cache routine. EXPECTED DIFFERENCES: None. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@8572 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/gdevpdti.c')
-rw-r--r--gs/src/gdevpdti.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gs/src/gdevpdti.c b/gs/src/gdevpdti.c
index 14b48c2a7..9d0fb224d 100644
--- a/gs/src/gdevpdti.c
+++ b/gs/src/gdevpdti.c
@@ -614,6 +614,9 @@ pdf_enter_substream(gx_device_pdf *pdev, pdf_resource_type_t rtype,
pdev->context = PDF_IN_STREAM;
pdev->accumulating_substream_resource = pres;
pdev->last_charpath_op = 0;
+ /* Do not alter type3charpath, inherit the current value. We need to know if */
+ /* we are inside a charpath operation, and only reset this when the charpath */
+ /* is complete */
pdf_reset_graphics(pdev);
*ppres = pres;
return 0;