Hello All,device space to be different in vertical and horizontal directions.
The width of a line in PostScript is defined in terms of distances in the user space. In my use case, the aspect ratio of the device space (e.g. 4:3) is different from the aspect ratio of the user space (e.g. 1:1), which causes the line widths in the
How to make line widths the same regardless of the line orientation? The PostScript Language Reference Manual for setlinewidth mentions that if the current transformation matrix (CTM) in effect at the time of the stroke specifies scaling by differentfactors in the x and y dimensions, then thickness of the lines can vary.
Does this mean that if I set a CTM with the same scaling factor in x and y dimensions before calling stroke and them reset the CTM to the value used elsewhere in the PostScript file, the line widths will be the same without affecting anything else?
Thanks,
Eremey
Hello All,device space to be different in vertical and horizontal directions.
The width of a line in PostScript is defined in terms of distances in the user space. In my use case, the aspect ratio of the device space (e.g. 4:3) is different from the aspect ratio of the user space (e.g. 1:1), which causes the line widths in the
How to make line widths the same regardless of the line orientation? The PostScript Language Reference Manual for setlinewidth mentions that if the current transformation matrix (CTM) in effect at the time of the stroke specifies scaling by differentfactors in the x and y dimensions, then thickness of the lines can vary.
Does this mean that if I set a CTM with the same scaling factor in x and y dimensions before calling stroke and them reset the CTM to the value used elsewhere in the PostScript file, the line widths will be the same without affecting anything else?
Thanks,
Eremey
On Tuesday, October 6, 2020 at 4:56:00 AM UTC-5, Eremey Valetov wrote:device space to be different in vertical and horizontal directions.
Hello All,
The width of a line in PostScript is defined in terms of distances in the user space. In my use case, the aspect ratio of the device space (e.g. 4:3) is different from the aspect ratio of the user space (e.g. 1:1), which causes the line widths in the
factors in the x and y dimensions, then thickness of the lines can vary.How to make line widths the same regardless of the line orientation? The PostScript Language Reference Manual for setlinewidth mentions that if the current transformation matrix (CTM) in effect at the time of the stroke specifies scaling by different
Does this mean that if I set a CTM with the same scaling factor in x and y dimensions before calling stroke and them reset the CTM to the value used elsewhere in the PostScript file, the line widths will be the same without affecting anything else?
Thanks,
Eremey
You can start with a uniform scaling matrix
4 4 matrix scale
And then multiply it by the inverse of the CTM
matrix currentmatrix matrix invertmatrix matrix concatmatrix
Now if you `concat` this matrix onto the CTM, then the CTM will become exactly the uniform scaling matrix created on the first line.
hth
On 10/06/2020 02:55 AM, Eremey Valetov wrote:device space to be different in vertical and horizontal directions.
Hello All,
The width of a line in PostScript is defined in terms of distances in the user space. In my use case, the aspect ratio of the device space (e.g. 4:3) is different from the aspect ratio of the user space (e.g. 1:1), which causes the line widths in the
factors in the x and y dimensions, then thickness of the lines can vary.How to make line widths the same regardless of the line orientation? The PostScript Language Reference Manual for setlinewidth mentions that if the current transformation matrix (CTM) in effect at the time of the stroke specifies scaling by different
Does this mean that if I set a CTM with the same scaling factor in x and y dimensions before calling stroke and them reset the CTM to the value used elsewhere in the PostScript file, the line widths will be the same without affecting anything else?
Thanks,
Eremey
Without writing a test case, it would seem to me that changing the scale factor would not change the line width, but also the line position. Do
you have a sample .ps file that demonstrates what you want to acheive?
Jeff Coffield
www.digitalsynergyinc.com
On Tuesday, October 6, 2020 at 1:04:03 PM UTC-5, luser droog wrote:the device space to be different in vertical and horizontal directions.
On Tuesday, October 6, 2020 at 4:56:00 AM UTC-5, Eremey Valetov wrote:
Hello All,
The width of a line in PostScript is defined in terms of distances in the user space. In my use case, the aspect ratio of the device space (e.g. 4:3) is different from the aspect ratio of the user space (e.g. 1:1), which causes the line widths in
different factors in the x and y dimensions, then thickness of the lines can vary.How to make line widths the same regardless of the line orientation? The PostScript Language Reference Manual for setlinewidth mentions that if the current transformation matrix (CTM) in effect at the time of the stroke specifies scaling by
Does this mean that if I set a CTM with the same scaling factor in x and y dimensions before calling stroke and them reset the CTM to the value used elsewhere in the PostScript file, the line widths will be the same without affecting anything else?
Thanks,
Eremey
You can start with a uniform scaling matrix
4 4 matrix scale
And then multiply it by the inverse of the CTM
matrix currentmatrix matrix invertmatrix matrix concatmatrix
Now if you `concat` this matrix onto the CTM, then the CTM will become exactly the uniform scaling matrix created on the first line.
hthUgh. Made it too complicated.
matrix currentmatrix
4 4 matrix scale setmatrix
stroke
setmatrix
On 10/06/2020 02:55 AM, Eremey Valetov wrote:device space to be different in vertical and horizontal directions.
Hello All,
The width of a line in PostScript is defined in terms of distances in the user space. In my use case, the aspect ratio of the device space (e.g. 4:3) is different from the aspect ratio of the user space (e.g. 1:1), which causes the line widths in the
factors in the x and y dimensions, then thickness of the lines can vary.How to make line widths the same regardless of the line orientation? The PostScript Language Reference Manual for setlinewidth mentions that if the current transformation matrix (CTM) in effect at the time of the stroke specifies scaling by different
Does this mean that if I set a CTM with the same scaling factor in x and y dimensions before calling stroke and them reset the CTM to the value used elsewhere in the PostScript file, the line widths will be the same without affecting anything else?
Thanks,
Eremey
Without writing a test case, it would seem to me that changing the scale factor would not change the line width, but also the line position. Do
you have a sample .ps file that demonstrates what you want to acheive?
Jeff Coffield
www.digitalsynergyinc.com
On Tuesday, October 6, 2020 at 6:35:50 PM UTC-5, luser droog wrote:the device space to be different in vertical and horizontal directions.
On Tuesday, October 6, 2020 at 1:04:03 PM UTC-5, luser droog wrote:
On Tuesday, October 6, 2020 at 4:56:00 AM UTC-5, Eremey Valetov wrote:
Hello All,
The width of a line in PostScript is defined in terms of distances in the user space. In my use case, the aspect ratio of the device space (e.g. 4:3) is different from the aspect ratio of the user space (e.g. 1:1), which causes the line widths in
different factors in the x and y dimensions, then thickness of the lines can vary.How to make line widths the same regardless of the line orientation? The PostScript Language Reference Manual for setlinewidth mentions that if the current transformation matrix (CTM) in effect at the time of the stroke specifies scaling by
else?Does this mean that if I set a CTM with the same scaling factor in x and y dimensions before calling stroke and them reset the CTM to the value used elsewhere in the PostScript file, the line widths will be the same without affecting anything
Thanks,
Eremey
You can start with a uniform scaling matrix
4 4 matrix scale
And then multiply it by the inverse of the CTM
matrix currentmatrix matrix invertmatrix matrix concatmatrix
Now if you `concat` this matrix onto the CTM, then the CTM will become exactly the uniform scaling matrix created on the first line.
hthUgh. Made it too complicated.
matrix currentmatrix
4 4 matrix scale setmatrix
stroke
setmatrix
Hi luser droog,
Thanks! This fixed the issue with something like
matrix currentmatrix
750 750 matrix scale setmatrix
stroke
setmatrix
Because this requires knowing the horizontal size of the device space, which happens to be 750, I settled on this solution:
gsave 1 1.5 scale stroke newpath grestore
By the way, while this does resolve the issue in PostScript, in PDF this also results in the line coordinates being scaled vertically by the same coefficient 1.5. What would be a good place to ask the respective question about PDF?
Thanks,
Eremey
On Wednesday, October 7, 2020 at 5:48:40 AM UTC-5, Eremey Valetov wrote:in the device space to be different in vertical and horizontal directions.
On Tuesday, October 6, 2020 at 6:35:50 PM UTC-5, luser droog wrote:
On Tuesday, October 6, 2020 at 1:04:03 PM UTC-5, luser droog wrote:
On Tuesday, October 6, 2020 at 4:56:00 AM UTC-5, Eremey Valetov wrote:
Hello All,
The width of a line in PostScript is defined in terms of distances in the user space. In my use case, the aspect ratio of the device space (e.g. 4:3) is different from the aspect ratio of the user space (e.g. 1:1), which causes the line widths
different factors in the x and y dimensions, then thickness of the lines can vary.How to make line widths the same regardless of the line orientation? The PostScript Language Reference Manual for setlinewidth mentions that if the current transformation matrix (CTM) in effect at the time of the stroke specifies scaling by
else?Does this mean that if I set a CTM with the same scaling factor in x and y dimensions before calling stroke and them reset the CTM to the value used elsewhere in the PostScript file, the line widths will be the same without affecting anything
Thanks,
Eremey
You can start with a uniform scaling matrix
4 4 matrix scale
And then multiply it by the inverse of the CTM
matrix currentmatrix matrix invertmatrix matrix concatmatrix
Now if you `concat` this matrix onto the CTM, then the CTM will become exactly the uniform scaling matrix created on the first line.
hthUgh. Made it too complicated.
matrix currentmatrix
4 4 matrix scale setmatrix
stroke
setmatrix
Hi luser droog,
Thanks! This fixed the issue with something like
matrix currentmatrix
750 750 matrix scale setmatrix
stroke
setmatrix
Because this requires knowing the horizontal size of the device space, which happens to be 750, I settled on this solution:
gsave 1 1.5 scale stroke newpath grestore
By the way, while this does resolve the issue in PostScript, in PDF this also results in the line coordinates being scaled vertically by the same coefficient 1.5. What would be a good place to ask the respective question about PDF?
Thanks,Maybe swapping 'newpath' and 'grestore'? As it is, grestore will
Eremey
resurrect the path that you just discarded.
On Wednesday, October 7, 2020 at 10:40:55 AM UTC-5, luser droog wrote:widths in the device space to be different in vertical and horizontal directions.
On Wednesday, October 7, 2020 at 5:48:40 AM UTC-5, Eremey Valetov wrote:
On Tuesday, October 6, 2020 at 6:35:50 PM UTC-5, luser droog wrote:
On Tuesday, October 6, 2020 at 1:04:03 PM UTC-5, luser droog wrote:
On Tuesday, October 6, 2020 at 4:56:00 AM UTC-5, Eremey Valetov wrote:
Hello All,
The width of a line in PostScript is defined in terms of distances in the user space. In my use case, the aspect ratio of the device space (e.g. 4:3) is different from the aspect ratio of the user space (e.g. 1:1), which causes the line
different factors in the x and y dimensions, then thickness of the lines can vary.How to make line widths the same regardless of the line orientation? The PostScript Language Reference Manual for setlinewidth mentions that if the current transformation matrix (CTM) in effect at the time of the stroke specifies scaling by
else?Does this mean that if I set a CTM with the same scaling factor in x and y dimensions before calling stroke and them reset the CTM to the value used elsewhere in the PostScript file, the line widths will be the same without affecting anything
Thanks,
Eremey
You can start with a uniform scaling matrix
4 4 matrix scale
And then multiply it by the inverse of the CTM
matrix currentmatrix matrix invertmatrix matrix concatmatrix
Now if you `concat` this matrix onto the CTM, then the CTM will become
exactly the uniform scaling matrix created on the first line.
hthUgh. Made it too complicated.
matrix currentmatrix
4 4 matrix scale setmatrix
stroke
setmatrix
Hi luser droog,
Thanks! This fixed the issue with something like
matrix currentmatrix
750 750 matrix scale setmatrix
stroke
setmatrix
Because this requires knowing the horizontal size of the device space, which happens to be 750, I settled on this solution:
gsave 1 1.5 scale stroke newpath grestore
By the way, while this does resolve the issue in PostScript, in PDF this also results in the line coordinates being scaled vertically by the same coefficient 1.5. What would be a good place to ask the respective question about PDF?
Thanks,Maybe swapping 'newpath' and 'grestore'? As it is, grestore will
Eremey
resurrect the path that you just discarded.
Thanks, that makes sense. I swapped 'newpath' and 'grestore' in the PostScript code.
I made the corresponding revision to the PDF code,
'q 1 0 0 1.5 0 0 cm S Q h',
but this still has the side effect of vertically scaling the endpoints of the line segments, as pic002.pdf in this Filebin shows:
https://filebin.net/1pcf0p3pb922nw8k
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 88:31:10 |
Calls: | 6,658 |
Files: | 12,203 |
Messages: | 5,333,956 |