Skip to main content
Known Participant
July 22, 2008
Question

stroke and fill

  • July 22, 2008
  • 45 replies
  • 10642 views
I read in the PostScript documentation and i saw that stroke only has :
-linecap
-color
-mitterlimit
-linejoin
-thickness

I have to write an application and my class
Stroke, that i am using, has a lot of other stuff like PatternBrush, ImageBrush ,GradientBrush , etc.

Can i get this kind of options for stroke in a PostScript file?
How about Fill?
(I'm very interested in the gradient option. I haven't found so far very clear documentation about it)

Can I get a detailed explanation or(and) some reference?

[later edit]
Also, can i modify the matrix in one command (without using rotate, scale and translate).I bumped to this only when i was dealing with images and i haven't found something clear in the documentation about how can i do this just by a command. For now i just want to draw from the upper left corner of the page, but i will need it for other stuff too.

David
This topic has been closed for replies.

45 replies

Known Participant
August 20, 2008
If I want to write encoded version for:
TOBEORNOTTOBETOBEORNOT

how would I write it in the output so that the filter would understand it properly?

David.
Participating Frequently
August 20, 2008
It is over 10 years since I did any work on LZW, so I can't really
help you with that. You could use an LZWEncode filter, but be aware
that there is more than one way to encode the same data. GhostScript
uses a curious non-compressing method.

The algorithm only really defines how to decompress. That's fine, you
just have to contruct a stream which decompresses to the target you
want.

You are also using ASCII85. This is superficially simple, but can
introduce errors of its own. While working on LZW, I recommend using
ASCIIHex instead, to be sure of your data (and make it much easier to
read).

Aandi Inston
Known Participant
August 20, 2008
I will try on this forum also, hoping I will get a response:

How can I find how does the LZWDecode filter expects data?
I have implemented the algorithm and I didn't find the way I have to write the output in the ps file. I am pretty sure about the algorithm and it would help me very much if I would know how LZWDecode filter expects data.

David.
Participating Frequently
August 20, 2008
I have no idea what you mean, sorry. It expects data in the format
defined by the algorithm in the specification, but you know that
already, so what do you really want to know? Or to put it another way,
what is the problem you are trying to solve?

Aandi Inston
Known Participant
August 19, 2008
Now I have .Thanks.
Known Participant
August 19, 2008
I'm sorry for the questions, but I was kind of scared and I needed some help ...
Anyway I have one new problem .
I'm using ReusableStreamDecode filter and I used ASCII85 to encode the data, but when I use LZWDecode filter I get an error from gsview

<</Filter [/ASCII85Decode /LZWDecode]>>

And also, when I don't use this filter(ReusableStreamDecode) because it is availibile only for language level 3 printers and my data source is an array like this:

/CreateDataArray
{ /temp exch def
[{ temp 256 string readstring
not { exit} if
}loop
]
}
bind def
/ImageData_c:\temp\26\img.jpeg

currentfile
/ASCII85Decode filter CreateDataArray
s8N <<..data..>>

how can I use two filters in this second situations?

PS: I totally understand if you don't answer and I promise I will come only whit important things to ask on this forum if you do answer me.

Thanks,
David
Participating Frequently
August 19, 2008
It's not about being important, it's about whether the very few people
here have an answer. Did you try comp.lang.postscript as I suggested?
Many more people there.

Aandi Inston
Known Participant
August 8, 2008
I can see nobody wants to answer me ... anyway I managed to make it ...

And now I have another thing, long leaved alone ...
When I create image resources, using a string, and not an array with ASCII85, how should I use the /DataSource entry in the dictionary?

Can I declare the String as a resource in the
%%BeginSetup

%%EndSetup

and just use it (put it on the stack and use it after)

Or some kind of a procedure ?

David.
Participating Frequently
August 12, 2008
This is a very low volume discussion forum, and you've probably
reached the limits of the knowledge available here. This is very
specialised: I've written a PostScript interpreter, but I can't answer
your detailed questions on type 42 fonts. You might find someone who
knows the answer in comp.lang.postscript.

%%BeginSetup is a comment. It has no special meaning and does not
define anything.

It may MARK things for a program that processes the PostScript, but in
general there is no such program involved in printing.

/DataSource can simply be a string. It can be a string constant, or a
string variable defined anywhere above. Bear in mind the architectural
limit on string length.

Aandi Inston
Known Participant
August 7, 2008
Does anybody know how the bytes must be entered in the sfnts array?
I am working on this and it seems it must be parsed before displayng the bytes in the ps file ... by the loca, glyf, etc.
I'm kind of stuck ... on this because I first wrote the bytes as I found them in the font file it worked, without a few glyphs on an particular case and then whem I parsed(with a code already writen) it gives an error in GSView ... so my question is where can I find some kind of algorithm of how to put every table in this array ...
btw ... I have read with a lot of attention the PS ref book and type 42 Adobe Technical Note but I haven't found nothing.

David
Known Participant
August 6, 2008
For me to write the sfnts array do I have to follow some steps?
By that I mean where can I find an algorithm for this, I mean the order that I have to use to put the tables in the array ...
loca,head,htmx ...

Is it in the TTF specs?
David
Known Participant
August 6, 2008
:) I'm so sorry .. stupid question ...
I thought it is like Adobe reference notes (not a chapter in the PS ref book...:( ).

David
Known Participant
August 5, 2008
>No need for guesswork, it's in the Reference - 3.2.2, Literal Text
>Strings.

What is this and where can I find it? Is it available online?
(I didn't found it :()
David
Participating Frequently
August 5, 2008
>What is this and where can I find it?

Sorry, I'm just finding this hard to believe. You don't have the
PostScript Language Reference Manual? What are you using for
documentation?

Aandi Inston
Known Participant
August 5, 2008
I've played with some examples and I noticed that I can put the chars in the PS file like:

\000\0XY
XY = octal number from 03 to 37 (just before space = 40).

or

\000C
C = char from ' ' to '~' probably.
I am curious if I can use the 000, 001 and 002 and if no, why ...
(I don't think NULL SOH and STX have any meaning in this context)

David
Participating Frequently
August 5, 2008
>I've played with some examples and I noticed...

No need for guesswork, it's in the Reference - 3.2.2, Literal Text
Strings.
>
>\000\0XY
>XY = octal number from 03 to 37 (just before space = 40).

In a string, 3 digit octal escapes (and others) are allowed.
>
>or
>
>\000C
>C = char from ' ' to '~' probably.

This is simply an escape for binary zero followed by the normal
character C without any escape.

>I am curious if I can use the 000, 001 and 002 and if no, why ...

You can use any character code from 0 to 255, the entire encoding
array is available. However, I would avoid low character codes unless
you have to, as some of them seem to cause problems if converted to
PDF, in certain viewers.

>(I don't think NULL SOH and STX have any meaning in this context)

Correct.

Aandi Inston