Podium.Shape (Podium v0.3.0)

Copy Markdown View Source

Shape structs and XML generation for text boxes, auto shapes, and freeform shapes.

Shapes are created through text_box/3, auto_shape/3, or freeform/3 and rendered to OOXML via to_xml/3.

Summary

Functions

Creates an auto shape with a preset geometry.

Creates a freeform shape from a Freeform builder.

Creates a text box shape.

Types

t()

@type t() :: %Podium.Shape{
  anchor: Podium.anchor() | nil,
  auto_size: :none | :text_to_fit_shape | :shape_to_fit_text | nil,
  fill: Podium.fill() | nil,
  fill_opts: keyword() | nil,
  height: non_neg_integer(),
  id: pos_integer(),
  line: Podium.line() | nil,
  margin_bottom: non_neg_integer() | nil,
  margin_left: non_neg_integer() | nil,
  margin_right: non_neg_integer() | nil,
  margin_top: non_neg_integer() | nil,
  name: String.t(),
  paragraphs: [map()] | nil,
  path_data: map() | nil,
  preset: atom() | nil,
  rotation: number() | nil,
  type: :text_box | :auto_shape | :freeform,
  width: non_neg_integer(),
  word_wrap: boolean() | nil,
  x: non_neg_integer(),
  y: non_neg_integer()
}

Functions

auto_shape(id, preset, opts)

@spec auto_shape(pos_integer(), atom(), keyword()) :: t()

Creates an auto shape with a preset geometry.

freeform(id, fb, opts)

@spec freeform(pos_integer(), Podium.Freeform.t(), keyword()) :: t()

Creates a freeform shape from a Freeform builder.

text_box(id, text, opts)

@spec text_box(pos_integer(), Podium.rich_text(), keyword()) :: t()

Creates a text box shape.

to_xml(shape, fill_rid \\ nil, hyperlink_rids \\ %{})

@spec to_xml(t(), String.t() | nil, map()) :: String.t()

Generates XML for a shape.