a:ln (Line Properties)

Specifies stroke/outline properties for shapes, including width, color, dash style, and line end/join styles.

Description

a:ln (Line Properties) is the comprehensive stroke/outline container for DrawingML. It is defined in ECMA-376 Part 1 §20.1.2.2.13 and controls all visual properties of a line or shape outline, including width, color, dash pattern, end caps, and joins.

Purpose and Scope

Line properties control the appearance of:

  • Shape outlines — Borders of rectangles, circles, polygons
  • Connectors — Lines and arrows connecting shapes
  • Text underlines — Text run decorations
  • Table borders — Cell and table grid lines
  • Path strokes — Custom geometry outlines

Line properties consist of three groups:

  1. Stroke Appearance — Width, color (fill), and dash pattern
  2. End Styling — Line cap style, arrow heads/tails
  3. Join Styling — How corners/joins are rendered

Rendering Workflow

  1. Determine stroke width — Read w attribute
  2. Determine stroke color — Read fill child element
  3. Determine stroke pattern — Read dash style
  4. Determine end caps — Read cap attribute
  5. Determine joins — Read join element (round, bevel, miter)
  6. Determine arrow heads — Read a:headEnd/a:tailEnd
  7. Render — Paint outline with all properties applied

Attributes

Attribute Type Range Default Description
w Integer (EMU) 0–20116800 12700 Stroke width in EMUs. 12700 = 1pt. 0 = hairline.
cap Enum flat, rnd, sq flat Line cap style at ends: flat, round, or square.
cmpd Enum sng, dbl, dblDot, thickThin, thinThick, tri sng Compound line: single, double, triple, or mixed.
algn Enum ctr, in ctr Pen alignment: centered on edge or inside edge.
prstDash Enum solid, sysDot, dash, lgDash, dashDot, lgDashDot, lgDashDotDot solid Preset dash pattern.

Content Model

a:ln (attributes)
├─ Fill (one of, 0–1)
│  ├─ a:solidFill (solid color)
│  ├─ a:gradFill (gradient)
│  ├─ a:pattFill (pattern)
│  └─ a:noFill (no stroke)
├─ a:prstDash (Preset Dash Pattern, 0–1)
├─ a:custDash (Custom Dash Pattern, 0–1)
├─ a:round (Round Join, 0–1)
├─ a:bevel (Bevel Join, 0–1)
├─ a:miter (Miter Join, 0–1)
├─ a:headEnd (Arrow Head, 0–1)
├─ a:tailEnd (Arrow Tail, 0–1)
├─ a:prstShadow (Preset Shadow, 0–1)
├─ a:outerShdw (Outer Shadow, 0–1)
└─ a:extLst (Extension List, 0–1)

Child Elements

Element Occurrence Purpose
Fill element 0–1 Stroke color: solid, gradient, pattern, or no fill
a:prstDash 0–1 Preset dash pattern (solid, dash, dot, etc.)
a:custDash 0–1 Custom dash pattern (user-defined dashes/gaps)
Join element 0–1 Line join style: round, bevel, or miter
a:headEnd 0–1 Arrow head at start of line
a:tailEnd 0–1 Arrow tail at end of line

Examples

Simple Solid Black Outline

<a:ln w="12700">
  <a:solidFill>
    <a:srgbClr val="000000"/>
  </a:solidFill>
</a:ln>

Dashed Line with Round Caps

<a:ln w="25400" cap="rnd">
  <a:solidFill>
    <a:srgbClr val="0070C0"/>
  </a:solidFill>
  <a:prstDash val="dash"/>
  <a:round/>
</a:ln>

Double Line with Bevel Joins

<a:ln w="38100" cmpd="dbl">
  <a:solidFill>
    <a:schemeClr val="accent1"/>
  </a:solidFill>
  <a:prstDash val="solid"/>
  <a:bevel/>
</a:ln>

Line with Gradient Stroke and Arrow Heads

<a:ln w="19050" cap="rnd">
  <a:gradFill>
    <a:gsLst>
      <a:gs pos="0"><a:srgbClr val="FF6B6B"/></a:gs>
      <a:gs pos="100000"><a:srgbClr val="FFD93D"/></a:gs>
    </a:gsLst>
    <a:lin ang="2700000" scaled="1"/>
  </a:gradFill>
  <a:prstDash val="solid"/>
  <a:round/>
  <a:headEnd type="triangle" w="381000" len="342900"/>
  <a:tailEnd type="triangle" w="381000" len="342900"/>
</a:ln>

Dotted Line with Square Caps (No Fill Interior)

<a:ln w="12700" cap="sq">
  <a:solidFill>
    <a:srgbClr val="70AD47"/>
  </a:solidFill>
  <a:prstDash val="sysDot"/>
  <a:miter/>
</a:ln>

Thick 3-Point Line with Inside Alignment

<a:ln w="38100" algn="in">
  <a:solidFill>
    <a:srgbClr val="2F5233"/>
  </a:solidFill>
  <a:prstDash val="solid"/>
  <a:round/>
</a:ln>

Thin Double-Dotted Line

<a:ln w="19050" cmpd="dblDot">
  <a:solidFill>
    <a:schemeClr val="accent2"/>
  </a:solidFill>
  <a:prstDash val="solid"/>
  <a:bevel/>
</a:ln>

Line Width Reference (EMU)

EMU Points Inches Thickness Use Case
0 Hairline <0.01” Thinnest visible Grid lines, subtle borders
6350 0.5pt 0.007” Very thin Light guides, subtle outlines
12700 1pt 0.014” Thin Standard borders, default
19050 1.5pt 0.021” Medium-thin Emphasized lines
25400 2pt 0.028” Medium Prominent borders
38100 3pt 0.042” Bold Strong emphasis
50800 4pt 0.056” Very bold Heavyweight borders
76200 6pt 0.084” Heavy Title/section separators

Dash Pattern Reference

Preset Appearance Use Case
solid ——— Standard borders, outlines (most common)
sysDot · · · Light dotted lines, grid
dash – – – Dashed lines, placeholder outlines
lgDash —– —– Long dashes, section breaks
dashDot –·–·– Dash-dot pattern, technical drawings
lgDashDot —–·—–· Long dash-dot, emphasis
lgDashDotDot —–··—–· Long dash-dot-dot, decorative

Line Cap (End Style)

Cap Value Appearance Use Case
flat Straight cut Default, technical drawings
rnd Rounded end Smooth, decorative, modern
sq Square end Geometric, technical, formal

Line Join (Corner Style)

Join Appearance Use Case
round Rounded corners Smooth, modern designs
bevel Cut diagonal Technical, geometric
miter Sharp point (with limit) Default for sharp corners

Compound Line Patterns

Compound Pattern Visual Use Case
sng Single line ——— Standard, default
dbl Double line ═══ Emphasis, section breaks
tri Triple line ═╪═ Strong emphasis, decorative
thickThin Thick + thin ═─ Asymmetric emphasis
thinThick Thin + thick ─═ Asymmetric emphasis (reversed)
dblDot Double dotted ·:·: Subtle double, grid

Arrow Head Types

Type Shape Use Case
none No arrow Lines, connectors without direction
triangle ▶ Filled triangle Standard arrows, flow diagrams
stealth ► Stealth/modern Modern diagrams, slick appearance
open ⊳ Open triangle Light emphasis, outline style
oval ⚫ Circle Flowcharts, markers
diamond ◆ Diamond Network diagrams, special nodes

Notes

Element Relationships

  • Parents (8 container elements):
    • a:spPr (shape properties): Primary shape outline.
    • a:txBody (text body): Outline around text/characters (rarely used).
    • a:tblPr (table properties): Default line style for table borders.
    • Lines (a:lnL, a:lnR, a:lnT, a:lnB): Individual borders on table cells (left, right, top, bottom).
  • Children (optional stroke definition elements):
    • Fill: a:solidFill, a:gradFill, a:pattFill, a:noFill (zero or one) for line color/gradient
    • Dash: a:prstDash (preset dash pattern) or a:custDash (custom dash pattern)
    • Joins: a:round, a:bevel, a:miter (line join style—corners)
    • Endings: a:headEnd (arrow head), a:tailEnd (arrow tail) for line decorations

General Notes

  • Width Units: EMU (English Metric Units); 914400 EMU = 1 inch = 72pt. Common: 12700 = 1pt, 25400 = 2pt, 38100 = 3pt.
  • Outline vs Border: In DrawingML context, a:ln is a line stroke around shape/text geometry, not a table border. Table borders use individual cell lines (a:lnL, a:lnR, a:lnT, a:lnB).
  • No Stroke: Use a:noFill as child element to render shape with no outline (invisible border).
  • Single Stroke Definition: A shape can have only one outline. Multiple a:ln elements are invalid; use groups or connectors for multi-stroke effects.
  • Dash Patterns: a:prstDash (preset) or a:custDash (custom) define stroke pattern. Preset is most common.
  • Color Gradient: Line fills can be solid, gradient, or pattern—not just single colors. Gradients flow along the stroke direction.
  • Arrow Heads: a:headEnd and a:tailEnd add arrows or other line endings (circles, diamonds, etc.). Only applicable to connector shapes.
  • Line Joins: Line join styles (a:round, a:bevel, a:miter) control how line segments connect (corners). Default is miter.
  • Compatibility: Line properties structure is consistent across all Office formats supporting shapes (Presentation, Drawing, Spreadsheet).