Bug 692584 - TextFormat=1 broken
Summary: TextFormat=1 broken
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Text (show other bugs)
Version: master
Hardware: PC Windows 7
: P4 normal
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-12 16:34 UTC by Ray Johnston
Modified: 2011-10-13 05:19 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
alphabet.pdf (14.28 KB, application/pdf)
2011-10-12 16:34 UTC, Ray Johnston
Details
alphabet-TextFormat-1.txt (3.84 KB, text/plain)
2011-10-12 16:35 UTC, Ray Johnston
Details

Note You need to log in before you can comment on or make changes to this bug.
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.