pub struct ShapeStyle {
pub line_color: Option<Color>,
pub fill_color: Option<Color>,
pub line_width: Option<u32>,
pub line_style: Option<LineStyle>,
pub rotation: Option<f32>,
pub flip: Option<Flip>,
pub head_arrow: Option<ArrowStyle>,
pub tail_arrow: Option<ArrowStyle>,
pub fill: Option<Fill>,
pub drop_cap_style: DropCapStyle,
}Expand description
Visual style overrides for drawing shapes.
All fields are Option; None means “use the encoder’s default”
(typically black solid border, white fill, 0.12 mm stroke).
§Examples
use hwpforge_core::control::{ShapeStyle, LineStyle};
use hwpforge_foundation::Color;
let style = ShapeStyle {
line_color: Some(Color::from_rgb(255, 0, 0)),
fill_color: Some(Color::from_rgb(0, 255, 0)),
line_width: Some(100),
line_style: Some(LineStyle::Dash),
..Default::default()
};Fields§
§line_color: Option<Color>Stroke/border color (e.g. Color::from_rgb(255, 0, 0) for red).
fill_color: Option<Color>Fill color (e.g. Color::from_rgb(0, 255, 0) for green).
For advanced fills (gradient, pattern, image), use the fill field instead.
line_width: Option<u32>Stroke width in HWPUNIT (33 ≈ 0.12mm, 100 ≈ 0.35mm).
line_style: Option<LineStyle>Line drawing style (solid, dash, dot, etc.).
rotation: Option<f32>Rotation angle in degrees (0-360). None means no rotation.
flip: Option<Flip>Flip/mirror state. None means no flip.
head_arrow: Option<ArrowStyle>Arrowhead at the start of a line. Only meaningful for Control::Line.
tail_arrow: Option<ArrowStyle>Arrowhead at the end of a line. Only meaningful for Control::Line.
fill: Option<Fill>Advanced fill (gradient, pattern, image). Overrides fill_color when present.
drop_cap_style: DropCapStyleDrop cap style for the shape (HWPX dropcapstyle attribute).
Controls whether the shape participates in a drop-cap layout.
Trait Implementations§
Source§impl Clone for ShapeStyle
impl Clone for ShapeStyle
Source§fn clone(&self) -> ShapeStyle
fn clone(&self) -> ShapeStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ShapeStyle
impl Debug for ShapeStyle
Source§impl Default for ShapeStyle
impl Default for ShapeStyle
Source§fn default() -> ShapeStyle
fn default() -> ShapeStyle
Source§impl<'de> Deserialize<'de> for ShapeStyle
impl<'de> Deserialize<'de> for ShapeStyle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ShapeStyle
impl JsonSchema for ShapeStyle
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more