XPS 0.95 Hairline Strokes

Although the XPS specificaton does not natively support designating certain strokes as hairlines, feedback has shown that the specification should provide a recommendation regarding how producers and consumers that need these features can include the information in an XPS Document in a consistent manner.

Consequently, we have included the following convention in the XPS specification v0.95. Most producers and consumers can safely ignore this convention; it is of primary benefit to workflows centered around technical drawings.

As always, contact xpsinfo@microsoft.com with questions.

11.6.12 Consistent Nominal Stroke Width

For certain scenarios, it is desirable for producers to generate documents targeted at specific aliasing consumers with particular lines in the document indicated as hairlines or consistent-width strokes. The following recommendation allows these producers and consumers to handle these strokes consistently.

Producers MAY generate a <Path> element intended to be treated as having a consistent nominal stroke width by specifying the StrokeDashArray attribute and by specifying the StrokeDashOffset attribute value less than -1.0 times the sum of all the numbers in the StrokeDashArray attribute value [O11.25].

For a solid line, the producer would set the StrokeDashArray to the value “1 0” and the StrokeDashOffset to a value such as “-2”. The “-2” value fulfills the restriction on the StrokeDashOffset value in a numerically stable manner, and the phase of the dash pattern is identical to a StrokeDashOffset value of “0”. Values less than “-2” can be used to specify a shifted phase of the dash pattern.

A stroke using the consistent nominal stroke width convention SHOULD be rendered with a width consistent with other strokes using the convention that have the same StrokeThickness attribute value, and consumers aware of this convention SHOULD render such a stroke no thinner than the thinnest visible line that consumer supports without dropouts [S11.31]. See section 11.1.4, “Pixel Center Location, Pixel Placement, and Pixel Inclusion”, for further considerations for rendering thin lines.