1. setlinejoin

Sets the line join style for stroking operations.

1.1. Syntax

int setlinejoin → –

1.2. Stack Effects

Table 1. Before
Level Object

0

int (0, 1, or 2)

Table 2. After
Level Object

(empty)

Line join parameter set

1.3. Description

setlinejoin sets the line join parameter to int, which must be 0, 1, or 2. This controls how corners are rendered when path segments meet at an angle during [stroke].

Join styles: * 0 = Miter join: outer edges extended until they meet * 1 = Round join: circular arc fills corner * 2 = Bevel join: corner filled with triangle

1.4. PostScript Level

Level 1 and later

1.5. Examples

Different join styles
10 setlinewidth

0 setlinejoin  % Miter
0 0 moveto 50 30 lineto 100 0 lineto stroke

1 setlinejoin  % Round
0 50 moveto 50 80 lineto 100 50 lineto stroke

2 setlinejoin  % Bevel
0 100 moveto 50 130 lineto 100 100 lineto stroke
Impact on rectangles
5 setlinewidth

0 setlinejoin
0 0 100 100 rectstroke  % Sharp corners

1 setlinejoin
120 0 100 100 rectstroke  % Rounded corners

1.6. Common Use Cases

1.6.1. Technical Drawings

0 setlinejoin  % Miter - sharp, precise
0.5 setlinewidth
drawBlueprintElements

1.6.2. Artistic Graphics

1 setlinejoin  % Round - smooth, organic
drawArtwork

1.6.3. CAD Applications

2 setlinejoin  % Bevel - clean, predictable
drawMechanicalParts

1.7. Common Pitfalls

Miter Limit - Very sharp miters may be converted to bevels (see setmiterlimit).
0 setlinejoin  % Miter
1 setmiterlimit  % But convert all to bevel!
Wide Lines - Join style most visible with wide lines.
0.1 setlinewidth  % Joins barely visible
10 setlinewidth   % Joins very visible
Round for Smooth - Round joins produce smoothest appearance.

1.8. Error Conditions

Error Condition

[rangecheck]

int not 0, 1, or 2

[stackunderflow]

No operand on stack

[typecheck]

Operand not an integer

1.9. Line Join Styles

Visual comparison (10-unit width, 45° angle)
Miter (0):    ╱╲
              ╱  ╲

Round (1):    ╱⌢╲
              ╱  ╲

Bevel (2):    ╱─╲
              ╱  ╲

1.10. Implementation Notes

  • Default value: 0 (miter)

  • Applies to all subsequent strokes

  • Miter joins controlled by miter limit

  • Fast parameter setting

1.11. See Also


Back to top

Copyright © 2025 Ribose. PostScript is a trademark of Adobe. Distributed under the MIT License.