View Source Idmlx.StyleCreator.ObjectStyleCreator (idmlx v0.2.1)
Module responsible for creating Object Style XML blocks for InDesign IDML documents.
This module provides functions to create and customize object styles with attributes such as fill, stroke, corner options, and text frame properties.
Summary
Functions
Applies the style options to the base attributes map.
Creates a new object style with the given name and options.
Creates an inner Properties element containing complex properties for an object style.
Formats an object style element with potential inner Properties element.
Functions
Applies the style options to the base attributes map.
Creates a new object style with the given name and options.
Options
:fill_color
- Fill color name or RGB/CMYK values:fill_tint
- Tint percentage for the fill color (0-100):stroke_color
- Stroke color name or RGB/CMYK values:stroke_weight
- Width of the stroke:corner_radius
- Radius for rounded corners:applied_paragraph_style
- Paragraph style to apply to text in the object:stroke_type
- Type of stroke (e.g., "StrokeStyle/$ID/Solid"):corner_option
- Corner style (e.g., "None", "RoundedCorner"):imported
- Whether the style is imported (boolean):style_unique_id
- Unique ID for the style (string, generated if not provided):based_on
- The parent style this style inherits from (string)- Any other attributes defined in the ObjectStyle attributes schema
Examples
iex> Idmlx.StyleCreator.ObjectStyleCreator.create("TextFrame", %{
...> fill_color: "None",
...> stroke_color: "Black",
...> stroke_weight: 1,
...> corner_radius: 0,
...> applied_paragraph_style: "ParagraphStyle/BodyText"
...> })
Creates an inner Properties element containing complex properties for an object style.
Formats an object style element with potential inner Properties element.