Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #5390 > unrolled thread
| Started by | Harriet Bazley <harriet@bazleyfamily.co.uk> |
|---|---|
| First post | 2018-02-03 23:42 +0000 |
| Last post | 2018-02-09 14:52 +0000 |
| Articles | 9 — 6 participants |
Back to article view | Back to comp.sys.acorn.programmer
Printing dotted lines Harriet Bazley <harriet@bazleyfamily.co.uk> - 2018-02-03 23:42 +0000
Re: Printing dotted lines news@sprow.co.uk - 2018-02-03 23:55 -0800
Re: Printing dotted lines Harriet Bazley <harriet@bazleyfamily.co.uk> - 2018-02-04 18:03 +0000
Re: Printing dotted lines Rick Murray <Rick@bogus.email.address> - 2018-02-04 20:27 +0100
Re: Printing dotted lines Steve Fryatt <news@stevefryatt.org.uk> - 2018-02-04 22:50 +0000
Re: Printing dotted lines Martin Wuerthner <spamtrap@mw-software.com> - 2018-02-08 12:06 +0100
Re: Printing dotted lines Harriet Bazley <harriet@bazleyfamily.co.uk> - 2018-02-09 01:15 +0000
Re: Printing dotted lines Matthew Phillips <spam2011m@yahoo.co.uk> - 2018-02-09 08:20 +0000
Re: Printing dotted lines Harriet Bazley <harriet@bazleyfamily.co.uk> - 2018-02-09 14:52 +0000
| From | Harriet Bazley <harriet@bazleyfamily.co.uk> |
|---|---|
| Date | 2018-02-03 23:42 +0000 |
| Subject | Printing dotted lines |
| Message-ID | <ece4cdc456.harriet@blueyonder.co.uk> |
Trying to work out why Powerbase prints dotted lines to screen but not to
printer - I've managed the following attempted test case program.
The PLOT code in PROCdiagonal produces converging dotted and solid lines on
screen, but two converging solid lines when sent to the printer.
Are the PLOT codes in the range 16-23 not suitable for use in hard copy?
-------------------------------------------------------------------------
DIM area% 16
DIM transform% 16
DIM origin% 8
DIM draw_rectangle% 16
MODE 32
PROCdiagonal
handle%=OPENOUT("printer:")
IF handle%=0 THEN END
SYS "PDriver_SelectJob",handle%,"Dotted test"
area%!0=0:area%!4=0:area%!8=800:area%!12=800
transform%!0=(1<<16):transform%!4=0:transform%!8=0:transform%!12=(1<<16)
origin%!0=1024:origin%!4=1024
SYS "PDriver_GiveRectangle",1,area%,transform%,origin%,&FF000000
SYS "PDriver_DrawPage",1,draw_rectangle%,0,0
PROCdiagonal
SYS "PDriver_EndJob", handle%
CLOSE#handle%
END
DEF PROCdiagonal
MOVE 50,150
PLOT 5, 600, 600
MOVE 50,250
PLOT 21, 600, 600
ENDPROC
--
Harriet Bazley == Loyaulte me lie ==
Nothing is foolproof - to a sufficiently talented fool
[toc] | [next] | [standalone]
| From | news@sprow.co.uk |
|---|---|
| Date | 2018-02-03 23:55 -0800 |
| Message-ID | <cb223dc0-3aed-4fed-8d15-c336506abd35@googlegroups.com> |
| In reply to | #5390 |
On Saturday, 3 February 2018 23:52:08 UTC, Harriet Bazley wrote: > Trying to work out why Powerbase prints dotted lines to screen but not to > printer - I've managed the following attempted test case program. > > Are the PLOT codes in the range 16-23 not suitable for use in hard copy? In the bit image driver there looks to be some prototype code https://www.riscosopen.org/viewer/view/castle/RiscOS/Sources/Printing/Modules/PDModules/s/PDriverDP/Plot?rev=4.2;content-type=text%2Fx-cvsweb-markup#l264 however nobody ever got round to writing the PostScript equivalent https://www.riscosopen.org/viewer/view/castle/RiscOS/Sources/Printing/Modules/PDModules/s/PDriverPS/Plot?rev=4.1.7.1;content-type=text%2Fx-cvsweb-markup#l229 and so to ensure they're both consistent, it's disabled in both https://www.riscosopen.org/viewer/view/castle/RiscOS/Sources/Printing/Modules/PDModules/s/Core/PDriver?rev=4.10;content-type=text%2Fx-cvsweb-markup#l105 Or, in short, no - solid lines only at the moment, Sprow.
[toc] | [prev] | [next] | [standalone]
| From | Harriet Bazley <harriet@bazleyfamily.co.uk> |
|---|---|
| Date | 2018-02-04 18:03 +0000 |
| Message-ID | <3aba32c556.harriet@blueyonder.co.uk> |
| In reply to | #5392 |
On 4 Feb 2018 as I do recall,
news@sprow.co.uk wrote:
> On Saturday, 3 February 2018 23:52:08 UTC, Harriet Bazley wrote:
> > Trying to work out why Powerbase prints dotted lines to screen but not to
> > printer - I've managed the following attempted test case program.
> >
> > Are the PLOT codes in the range 16-23 not suitable for use in hard copy?
[snip]
> Or, in short, no - solid lines only at the moment,
Thanks - is there a recommended way of printing dotted lines?
(Surely commercial programs must do this sometimes?)
--
Harriet Bazley == Loyaulte me lie ==
Many are called, few are chosen. Fewer still get to do the choosing.
[toc] | [prev] | [next] | [standalone]
| From | Rick Murray <Rick@bogus.email.address> |
|---|---|
| Date | 2018-02-04 20:27 +0100 |
| Message-ID | <56c53a65e5Rick@bogus.email.address> |
| In reply to | #5399 |
In article <3aba32c556.harriet@blueyonder.co.uk>, > Thanks - is there a recommended way of printing dotted lines? Probably not useful but... DrawFile? Plotting pixels manually? -- ___ /__/ o __ /_ / \ / /__ / \ (heyrick one nine seven three at yahoo dot co dot uk)
[toc] | [prev] | [next] | [standalone]
| From | Steve Fryatt <news@stevefryatt.org.uk> |
|---|---|
| Date | 2018-02-04 22:50 +0000 |
| Message-ID | <mpro.p3ne3x043fndh01x2.news@stevefryatt.org.uk> |
| In reply to | #5399 |
On 4 Feb, Harriet Bazley wrote in message
<3aba32c556.harriet@blueyonder.co.uk>:
> On 4 Feb 2018 as I do recall,
> news@sprow.co.uk wrote:
>
> > On Saturday, 3 February 2018 23:52:08 UTC, Harriet Bazley wrote:
> > > Trying to work out why Powerbase prints dotted lines to screen but not
> > > to printer - I've managed the following attempted test case program.
> > >
> > > Are the PLOT codes in the range 16-23 not suitable for use in hard
> > > copy?
>
> [snip]
>
> > Or, in short, no - solid lines only at the moment,
>
> Thanks - is there a recommended way of printing dotted lines? (Surely
> commercial programs must do this sometimes?)
The Draw module (Draw_Stroke, etc).
In fact, the PRM states (p 3-564) that "you should use calls to the Draw
module to print object-oriented graphics such as rectangles. This is
preferable to using VDU and PLOT sequences."
Very possibly for exactly this reason...
--
Steve Fryatt - Leeds, England
http://www.stevefryatt.org.uk/
[toc] | [prev] | [next] | [standalone]
| From | Martin Wuerthner <spamtrap@mw-software.com> |
|---|---|
| Date | 2018-02-08 12:06 +0100 |
| Message-ID | <mpro.p3tw7f000qzav020k.spamtrap@mw-software.com> |
| In reply to | #5401 |
Steve Fryatt <news@stevefryatt.org.uk> wrote: > On 4 Feb, Harriet Bazley wrote in message > <3aba32c556.harriet@blueyonder.co.uk>: > > > On 4 Feb 2018 as I do recall, > > news@sprow.co.uk wrote: > > > > > On Saturday, 3 February 2018 23:52:08 UTC, Harriet Bazley wrote: > > > > Trying to work out why Powerbase prints dotted lines to screen but > > > > not to printer - I've managed the following attempted test case > > > > program. > > > > > > > > Are the PLOT codes in the range 16-23 not suitable for use in hard > > > > copy? > > > > [snip] > > > > > Or, in short, no - solid lines only at the moment, > > > > Thanks - is there a recommended way of printing dotted lines? (Surely > > commercial programs must do this sometimes?) > > The Draw module (Draw_Stroke, etc). > > In fact, the PRM states (p 3-564) that "you should use calls to the Draw > module to print object-oriented graphics such as rectangles. This is > preferable to using VDU and PLOT sequences." In addition to this generic advice, there is detailed information about each individual PLOT code in the table headed "Treatment of character sequences" in the WrchV section. Not surprisingly, on p 3-583 it states for PLOT 25,16-31: "Processed: plots solid line (use Draw_Stroke to get dotted lines)". So, this is documented behaviour, not just an accident of the current implementation. Various PLOT codes (e.g., line fill and rectangle copy) are even faulted. -- Martin Wuerthner MW Software http://www.mw-software.com/ ------- RISC OS Software for Design, Printing and Publishing --------
[toc] | [prev] | [next] | [standalone]
| From | Harriet Bazley <harriet@bazleyfamily.co.uk> |
|---|---|
| Date | 2018-02-09 01:15 +0000 |
| Message-ID | <cc9769c756.harriet@blueyonder.co.uk> |
| In reply to | #5401 |
On 4 Feb 2018 as I do recall,
Steve Fryatt wrote:
> On 4 Feb, Harriet Bazley wrote in message
> <3aba32c556.harriet@blueyonder.co.uk>:
>
> > On 4 Feb 2018 as I do recall,
> > news@sprow.co.uk wrote:
> >
> > > On Saturday, 3 February 2018 23:52:08 UTC, Harriet Bazley wrote:
> > > > Trying to work out why Powerbase prints dotted lines to screen but not
> > > > to printer - I've managed the following attempted test case program.
> > > >
> > > > Are the PLOT codes in the range 16-23 not suitable for use in hard
> > > > copy?
> >
> > [snip]
> >
> > > Or, in short, no - solid lines only at the moment,
> >
> > Thanks - is there a recommended way of printing dotted lines? (Surely
> > commercial programs must do this sometimes?)
>
> The Draw module (Draw_Stroke, etc).
Substituting the following code
DEF PROChrule(x%,y%,plot%)
SYS "Wimp_SetColour",rulewimpcol%
MOVE x%,y%
CASE plot% OF
WHEN 1:PLOT plot%,LenLineP%,0
WHEN 17:
draw%!200=0:REM offset of first dash
draw%!204=1:REM number of on/off elements in pattern
draw%!208=70:REM length of first (and only) element
REM set up draw path block
!draw%=2:REM Start of path, i.e. move to x,y
draw%!4=x%*256:REM draw units are 1/256 of OS units
draw%!8=y%*256
draw%!12=8:REM Draw line
draw%!16=draw%!4+(LenLineP%*256):REM absolute x value
draw%!20=draw%!8:REM no change in y
draw%!24=0: REM end of path
SYS "Draw_Stroke",draw%,0,0,0,0,0,draw%+200
ENDCASE
ENDPROC
for the PLOT 17 commands produces what looks like dashed lines on the
screen, but what looks like solid lines when printing to paper/PDF. Redraw
on the PDF is also *incredibly* slow (as is screen redraw under emulation on
Windows, apparently). If I zoom right in on the PDF I get what looks like
incredibly fine dots giving the impression of a solid line.
What is a sensible set of values for the 'dash pattern' block in order to
give the impression of a dotted line, and would it help if I could get
Draw_Stroke to produce something other than the default 'thin' line?
(Apparently you need to set up start and end cap information to alter the
line thickness....)
--
Harriet Bazley == Loyaulte me lie ==
Do not underestimate the power of the Force.
[toc] | [prev] | [next] | [standalone]
| From | Matthew Phillips <spam2011m@yahoo.co.uk> |
|---|---|
| Date | 2018-02-09 08:20 +0000 |
| Message-ID | <a08590c756.Matthew@sinenomine.freeserve.co.uk> |
| In reply to | #5404 |
In message <cc9769c756.harriet@blueyonder.co.uk> on 9 Feb 2018 Harriet Bazley wrote: > On 4 Feb 2018 as I do recall, > Steve Fryatt wrote: > > > On 4 Feb, Harriet Bazley wrote in message > > <3aba32c556.harriet@blueyonder.co.uk>: > > > > > On 4 Feb 2018 as I do recall, > > > news@sprow.co.uk wrote: > > > > > > > On Saturday, 3 February 2018 23:52:08 UTC, Harriet Bazley wrote: > > > > > Trying to work out why Powerbase prints dotted lines to screen but > > > > > not to printer - I've managed the following attempted test case > > > > > program. > > > > > > > > > > Are the PLOT codes in the range 16-23 not suitable for use in hard > > > > > copy? > > > > > > [snip] > > > > > > > Or, in short, no - solid lines only at the moment, > > > > > > Thanks - is there a recommended way of printing dotted lines? (Surely > > > commercial programs must do this sometimes?) > > > > The Draw module (Draw_Stroke, etc). > > Substituting the following code > > DEF PROChrule(x%,y%,plot%) > SYS "Wimp_SetColour",rulewimpcol% > MOVE x%,y% > CASE plot% OF > WHEN 1:PLOT plot%,LenLineP%,0 > WHEN 17: > draw%!200=0:REM offset of first dash > draw%!204=1:REM number of on/off elements in pattern > draw%!208=70:REM length of first (and only) element > REM set up draw path block > !draw%=2:REM Start of path, i.e. move to x,y > draw%!4=x%*256:REM draw units are 1/256 of OS units > draw%!8=y%*256 > draw%!12=8:REM Draw line > draw%!16=draw%!4+(LenLineP%*256):REM absolute x value > draw%!20=draw%!8:REM no change in y > draw%!24=0: REM end of path > SYS "Draw_Stroke",draw%,0,0,0,0,0,draw%+200 > ENDCASE > ENDPROC > > for the PLOT 17 commands produces what looks like dashed lines on the > screen, but what looks like solid lines when printing to paper/PDF. > Redraw on the PDF is also *incredibly* slow (as is screen redraw under > emulation on Windows, apparently). If I zoom right in on the PDF I get > what looks like incredibly fine dots giving the impression of a solid line. > > What is a sensible set of values for the 'dash pattern' block in order to > give the impression of a dotted line, and would it help if I could get > Draw_Stroke to produce something other than the default 'thin' line? > (Apparently you need to set up start and end cap information to alter the > line thickness....) Thin lines can cause a few issues. It's not that hard to set up start and end cap information. If you choose a bevelled or rounded join style, rather than mitred, then all the rest of the bytes in the join/cap block can be zero, giving you butt ends to the lines and no faffing about with mitre limits and so on. The StrongHelp manual says that if mitres and triangles are not used, the block need only be 4 bytes long. The start and end caps apply to each section of a dashed line (RiscOSM makes use of this for arrows along one-way streets) so if you set up the block as follows you would have rounded start/end to everything: draw%?100=1:REM rounded joins draw%?101=1:REM rounded start draw%?102=1:REM rounded end draw%?103=0:REM reserved If you want a dotted line, try this dash block: draw%!200=0 draw%!204=2 draw%!208=&200:REM Makes a fairly small blob - adjust in tandem with width draw%!212=&1000:REM distance between blobs - adjust as you wish A line width of &500 corresponds to a setting of 2 in Draw's line width styles. Hope that helps! -- Matthew Phillips Durham
[toc] | [prev] | [next] | [standalone]
| From | Harriet Bazley <harriet@bazleyfamily.co.uk> |
|---|---|
| Date | 2018-02-09 14:52 +0000 |
| Message-ID | <255ab4c756.harriet@blueyonder.co.uk> |
| In reply to | #5405 |
On 9 Feb 2018 as I do recall,
Matthew Phillips wrote:
[snip]
> The start and end caps apply to each section of a dashed line (RiscOSM makes
> use of this for arrows along one-way streets) so if you set up the block as
> follows you would have rounded start/end to everything:
>
> draw%?100=1:REM rounded joins
> draw%?101=1:REM rounded start
> draw%?102=1:REM rounded end
> draw%?103=0:REM reserved
>
> If you want a dotted line, try this dash block:
>
> draw%!200=0
> draw%!204=2
> draw%!208=&200:REM Makes a fairly small blob - adjust in tandem with width
> draw%!212=&1000:REM distance between blobs - adjust as you wish
>
> A line width of &500 corresponds to a setting of 2 in Draw's line width
> styles.
Thanks, that helps a lot. The values I was using were far too small!
--
Harriet Bazley == Loyaulte me lie ==
St George for England - St Pancras for Scotland
[toc] | [prev] | [standalone]
Back to top | Article view | comp.sys.acorn.programmer
csiph-web