Bug 692584

Summary: TextFormat=1 broken
Product: Ghostscript Reporter: Ray Johnston <ray.johnston>
Component: TextAssignee: Ken Sharp <ken.sharp>
Status: RESOLVED FIXED    
Severity: normal CC: arthur.k.ford
Priority: P4    
Version: master   
Hardware: PC   
OS: Windows 7   
Customer: Word Size: ---
Attachments: alphabet.pdf
alphabet-TextFormat-1.txt

Description Ray Johnston 2011-10-12 16:34:42 UTC
Created attachment 7982 [details]
alphabet.pdf

Running:

gswin32c -sDEVICE=txtwrite -o alphabet-TextFormat-1.txt -dTextFormat=1 \
    alphabet.pdf

Gives funky values for size, render mode, WMode, start, and end. See attached.
Comment 1 Ray Johnston 2011-10-12 16:35:34 UTC
Created attachment 7983 [details]
alphabet-TextFormat-1.txt
Comment 2 Arthur Ford 2011-10-13 03:47:32 UTC
minor printf changes

diff --git a/gdevtxtw.c.prev b/gdevtxtw.c
index 80f73ff..3390d9c 100644
--- a/gdevtxtw.c.prev
+++ b/gdevtxtw.c
@@ -547,7 +547,7 @@ static int decorated_text_output(gx_device_txtwrite_t *tdev)
     x_entry = tdev->PageData.unsorted_text_list;
     while (x_entry) {
         next_x = x_entry->next;
-        sprintf(TextBuffer, "<FontName=%s, size=%d, render mode=%d, WMode=%d,start=%d,%d, end= %d,%d> ",
+        sprintf(TextBuffer, "<FontName=%s, size=%f, render mode=%d, WMode=%d,start=%f,%f, end= %f,%f> ",
             x_entry->FontName, x_entry->size, x_entry->render_mode, x_entry->wmode, x_entry->start.x,
             x_entry->start.y, x_entry->end.x,x_entry->end.y);
         fwrite(TextBuffer, 1, strlen(TextBuffer), tdev->file);
Comment 3 Ray Johnston 2011-10-13 05:19:58 UTC
Thanks, Arthur. Fix committed as SHA1 b49fc2b7fbd16c81a3480660d27d36ebe94ab6d2

Works for me now.