pub enum GraphicsElem {
Fill(Color, Path),
Stroke(Length, Color, Path),
DashedStroke(Length, Dash, Color, Path),
Text {
pt: Point,
contents: Vec<(Length, PureHorzBox)>,
width: Length,
height: Length,
depth: Length,
transform: Option<(f64, f64, f64, f64)>,
},
Group(Vec<GraphicsElem>),
Clip(Path, Vec<GraphicsElem>),
}Expand description
One graphics element (GraphicD.element). place_graphics
(rustyfi-pdf) matches this exhaustively, without a wildcard arm.
Variants§
Fill(Color, Path)
Filled region, even-odd rule (upstream’s op_f').
Stroke(Length, Color, Path)
Stroked outline at the given line width.
DashedStroke(Length, Dash, Color, Path)
Dashed stroked outline (dashed-stroke), rendered with a PDF d
dash-array op alongside the same stroke ops as Stroke.
Text
draw-text: a text run anchored at pt (box-local, y-up; the run’s
leftmost baseline point). contents is the run laid out at NATURAL
width (upstream LineBreak.natural = determine_widths None,
widperfil = 0; here fit_cell(boxes, natural_width)), each box with
its x offset from pt. width/height/depth are the run’s
natural_metrics, stored at construction so graphics_bbox needs no
re-measure. Rendered by each PDF writer re-entering its own per-box
emission at pt + dx INSIDE place_graphics’s box-local cm frame.
Fields
contents: Vec<(Length, PureHorzBox)>transform: Option<(f64, f64, f64, f64)>The accumulated 2×2 linear transform (linear-transform-graphics,
row-major (a, b, c, d) — same convention as
linear_transform_point) applied to the run about its local
origin BEFORE the pt translation. None means identity: the run
is drawn upright at pt. Some appears once
rotate-graphics/scale-graphics is composed onto a draw-text;
the writer then emits the run under a cm carrying this matrix
(upstream’s lazy LinearTrans render-time cm).
Group(Vec<GraphicsElem>)
0.1 collection node (GraphicD.concat, dev-0-1-0 graphicD.ml:23):
unite-graphics’ payload. No 0.0.6-visible primitive builds one, so it
is unreachable from 0.0.6 rendering by construction.
Clip(Path, Vec<GraphicsElem>)
0.1 clip node (GraphicD.make_clip, graphicD.ml:97-98): render
contents clipped to clip (even-odd, Op_W' — graphicD.ml:331).
The port’s Path already carries N subpaths, standing in for
upstream’s path list. Never constructed by any 0.0.6 path, as Group.
Trait Implementations§
Source§impl Clone for GraphicsElem
impl Clone for GraphicsElem
Source§fn clone(&self) -> GraphicsElem
fn clone(&self) -> GraphicsElem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more