Method Cairo.Context()->set_hairline()
- Method
set_hairline
void
set_hairline(bool
set_hairline
)- Description
Sets lines within the cairo context to be hairlines. Hairlines are logically zero-width lines that are drawn at the thinnest renderable width possible in the current context.
On surfaces with native hairline support, the native hairline functionality will be used. Surfaces that support hairlines include:
pdf/ps: Encoded as 0-width line. win32_printing: Rendered with PS_COSMETIC pen. svg: Encoded as 1px non-scaling-stroke. script: Encoded with set-hairline function.
Cairo will always render hairlines at 1 device unit wide, even if an anisotropic scaling was applied to the stroke width. In the wild, handling of this situation is not well-defined. Some PDF, PS, and SVG renderers match Cairo's output, but some very popular implementations (Acrobat, Chrome, rsvg) will scale the hairline unevenly. As such, best practice is to reset any anisotropic scaling before calling stroke().
- Parameter
set_hairline
whether or not to set hairline mode