Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Possible bug in Mac Distiller's charpath?
Please consider the following code, also available at
www.jdawiseman.com/papers/bugs/20080216_charpath.ps
%!

% Julian D. A. Wiseman, 16th February 2008, www.jdawiseman.com

/FontSize 100 def
/Times-Roman FontSize selectfont
0 setgray  0.24 setlinewidth  1 setlinecap  1 setlinejoin  [] 0
setdash

72 72 FontSize 6 mul add moveto
(0) true charpath
(2) true charpath
stroke

72 72 FontSize 4.5 mul add moveto
FontSize 2 div FontSize rlineto  FontSize 2 div FontSize neg rlineto
stroke

72 72 FontSize 3 mul add moveto
(0) true charpath
FontSize 2 div FontSize rlineto  FontSize 2 div FontSize neg rlineto
(2) true charpath
stroke

showpage



GhostScript correctly outputs www.jdawiseman.com/papers/bugs/2008...>
stscript.pdf

But Mac Distiller (Professional, 8.1.0, 10/23/06) outputs
www.jdawiseman.com/papers/bugs/2008...acDistiller.pdf
which is missing the lines drawn by the two linetos (though not the
positioning affect). Mac Preview is very similar to the Distiller:
www.jdawiseman.com/papers/bugs/2008...ath_Preview.pdf

-- Please, am I doing something wrong?
-- Please, is there a workaround?
-- How can I nag Adobe to fix it? (The bug-submission page on Adobe
doesn't work!)

Report this thread to moderator Post Follow-up to this message
Old Post
jdaw1
02-17-08 12:21 AM


Re: Possible bug in Mac Distiller's charpath?
On Feb 16, 6:17 pm, jdaw1 <jdawise...@gmail.com> wrote:
> Please consider the following code, also available atwww.jdawiseman.com/pa
pers/bugs/20080216_charpath.ps
> %!
>
> % Julian D. A. Wiseman, 16th February 2008,www.jdawiseman.com
>
> /FontSize 100 def
> /Times-Roman FontSize selectfont
> 0 setgray  0.24 setlinewidth  1 setlinecap  1 setlinejoin  [] 0
> setdash
>
> 72 72 FontSize 6 mul add moveto
> (0) true charpath
> (2) true charpath
> stroke
>
> 72 72 FontSize 4.5 mul add moveto
> FontSize 2 div FontSize rlineto  FontSize 2 div FontSize neg rlineto
> stroke
>
> 72 72 FontSize 3 mul add moveto
> (0) true charpath
> FontSize 2 div FontSize rlineto  FontSize 2 div FontSize neg rlineto
> (2) true charpath
> stroke
>
> showpage
>
> GhostScript correctly outputswww.jdawiseman.com/papers/bugs/20080216_charp
ath_Ghostscript.pdf
>
> But Mac Distiller (Professional, 8.1.0, 10/23/06) outputswww.jdawiseman.co
m/papers/bugs/20080216_charpath_MacDistiller.pdf
> which is missing the lines drawn by the two linetos (though not the
> positioning affect). Mac Preview is very similar to the Distiller:www.jdawiseman
.com/papers/b...ath_Preview.pdf
>
> -- Please, am I doing something wrong?
> -- Please, is there a workaround?
> -- How can I nag Adobe to fix it? (The bug-submission page on Adobe
> doesn't work!)

Try a string false charpath. False is for stroking and true
is for filling or clipping.

Ed

Report this thread to moderator Post Follow-up to this message
Old Post
abeddie@hotmail.com
02-19-08 03:26 AM


Re: Possible bug in Mac Distiller's charpath?
> Try a string false charpath. False is for stroking and true
> is for filling or clipping.

Not quite.
-- The boolean is only relevant when the characters are for stroking.
Times-Roman is for filling.
-- If that were the problem, why would it affect the intervening
linetos but not the character paths themselves?
-- More convincingly, when tested, changing the boolean makes no
difference.

Also, the problem isn't caused by the 'hand drawn' path being open, as
adding  currentpoint closepath moveto  to the end of the rlineto lines
doesn't fix it either.

I'm stuck on this odd problem. Please could someone tell what happens
with PC distiller?

Report this thread to moderator Post Follow-up to this message
Old Post
jdaw1
02-19-08 03:26 AM


Re: Possible bug in Mac Distiller's charpath?
Bumping this as I'm sure that somebody will have a solution.

Report this thread to moderator Post Follow-up to this message
Old Post
jdaw1
02-26-08 12:16 AM


Re: Possible bug in Mac Distiller's charpath?
In article <4a93619f-78c4-46a2-9e44-
b8e64b67cd5c@o77g2000hsf.googlegroups.com>, jdawiseman@gmail.com says...
> Bumping this as I'm sure that somebody will have a solution.
>

Solution in what sense ? I agree that the result appears incorrect, and
is the same using Distiller 8 under Windows.

All the PostScript RIPs I have available to test with (Ghostscript, Jaws
and Harlequin) agree that the PDF produced is incorrect. Those which can
produce PDF output (Jaws and GS) produce 'correct' PDFs.

I don't have a copy of CPSI to test with, and the only person I know who
has one has quite an old copy. Amusingly, a version we already know has
a problem with charpath...

So it seems your only recourse is to use something other than Distiller,
or get Adobe to accept the bug (or explain why it isn't a bug ;-)

Can't help you with tha I'm afraid.


Ken

Report this thread to moderator Post Follow-up to this message
Old Post
ken
02-26-08 12:16 AM


Re: Possible bug in Mac Distiller's charpath?
If you are just looking for a work around, here is a way to restructure the
code that seems to work:

72 72 FontSize 3 mul add moveto
(0) true charpath
currentpoint stroke moveto
FontSize 2 div FontSize rlineto  FontSize 2 div FontSize neg rlineto
currentpoint stroke moveto
(2) true charpath
stroke

Thanks
Scott Prouty


--
Message posted using http://www.talkaboutprogramming.com...scrip
t/
More information at http://www.talkaboutprogramming.com/faq.html


Report this thread to moderator Post Follow-up to this message
Old Post
sjprouty
02-26-08 12:16 AM


Re: Possible bug in Mac Distiller's charpath?
Yes, you can stroke the path in three sections but that doesn't help
if there are line joining issues or you want to use the whole path for
clipping.

Note how adding clipping makes it REALLY different from Ghostscript:

%!PS-Bug
72 72 FontSize 3 mul add moveto
(0) true charpath
FontSize 2 div FontSize rlineto  FontSize 2 div FontSize neg rlineto
currentpoint moveto
(2) true charpath clip clippath initclip
stroke

showpage

I've seen this problem before and assumed it was related to "charpath
security" i.e. preventing the unauthorized extracting of copyrighted
font outlines. As such, a possible solution would be to use the
"superexec" operator with that magic number Adobe published in the
little black book to enable the use of "pathforall" on the character
outlines to extract all the lineto's and curveto's and then draw them
as a regular path (not a charpath).

-David W.

Report this thread to moderator Post Follow-up to this message
Old Post
deedubman@gmail.com
02-26-08 12:16 AM


Re: Possible bug in Mac Distiller's charpath?
> Yes, you can stroke the path in three sections but that doesn't help if ..
. you want to use the whole path for clipping.

Alas I do want to use it for clipping, so stroking in pieces doesn't
work.



> a possible solution would be to use the "superexec" operator with that magic numbe
r Adobe published in the little black book to enable the use of "pathforall" on the 
character outlines to extract all the lineto's and curveto's and then draw them as a
 re
gular path (not a charpath).

That might help. Thank you for the clue. An online search reveals code
using
1183615869 internaldict /superexec get exec
The only documentation I can find, at www.tinaja.com/glib/pssecrets.pdf,
says:
> Here's how to activate superexec: First, you do a 1183615869 internaldict begin. F
rom that point on, a {forall} superexec or a {get} superexec will often override and
 ignore any possible invalidaccess errors. This greatly expands your abilities to cu
sto
mize PostScript code and operations.

Please, is there fuller documentation anywhere? E.g., what does
"often" mean? This seems very useful.

Report this thread to moderator Post Follow-up to this message
Old Post
jdaw1
02-27-08 12:22 AM


Re: Possible bug in Mac Distiller's charpath?
superexec is also mention in www.tinaja.com/glib/atg2.pdf (a set of
reprints  of Computer Shopper series from November 1987 to December
1989!).

> The 1183615869 internaldict begin command will activate superexec for your use. Fo
r instance, if a  gives you an error, a  often will not. The same trick will often w
ork for {get} superexec.

Report this thread to moderator Post Follow-up to this message
Old Post
jdaw1
02-27-08 12:22 AM


Re: Possible bug in Mac Distiller's charpath?
http://pages.cs.wisc.edu/~ghost/doc....41_Interpreter
(a history of Ghostscript versions 3.n) says at the end of the section
entitled "30.7 Interpreter":

> Adds superexec, an undocumented operator that is equivalent to exec but
suppresses all invalidaccess checks.  NOT COMPLETED YET; currently
superexec
is equivalent to exec.  (zcontrol.c)

Which suggests that it doesn't work in GhostScript.

PS: I'm adding these links to this thread so that my code can contain
a single reference leading to everything.
% groups.google.com/group/comp.lang.postscript/browse_thread/thread/
8599a22cfa270e5f/

Report this thread to moderator Post Follow-up to this message
Old Post
jdaw1
02-27-08 03:16 AM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

PostScript archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:14 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.