{"route":"/en-US-v0.13.1/reference/text/underline/","title":"Underline","description":"Documentation for the `underline` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"example","name":"Example","children":[]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-stroke","name":"stroke","children":[]},{"id":"parameters-offset","name":"offset","children":[]},{"id":"parameters-extent","name":"extent","children":[]},{"id":"parameters-evade","name":"evade","children":[]},{"id":"parameters-background","name":"background","children":[]},{"id":"parameters-body","name":"body","children":[]}]}],"body":{"kind":"func","content":{"path":[],"name":"underline","title":"Underline","keywords":[],"oneliner":"Underlines text.","element":true,"contextual":false,"deprecation":null,"details":"<p>Underlines text.</p>\n<h2 id=\"example\">Example</h2>\n<div class=\"previewed-code\"><pre><code>This is <span class=\"typ-func\">#</span><span class=\"typ-func\">underline</span><span class=\"typ-punct\">[</span>important<span class=\"typ-punct\">]</span>.\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/c55f85cbccf075521fc87c8ea5d93ff4.png\" alt=\"Preview\"></div></div>","example":null,"self":false,"params":[{"name":"stroke","details":"<p>How to <a href=\"/en-US-v0.13.1/reference/visualize/stroke/\" title=\"stroke\">stroke</a> the line.</p>\n<p>If set to <code><span class=\"typ-key\">auto</span></code>, takes on the text's color and a thickness defined in\nthe current font.</p>","example":"<div class=\"previewed-code\"><pre><code>Take <span class=\"typ-func\">#</span><span class=\"typ-func\">underline</span><span class=\"typ-punct\">(</span>\n  stroke<span class=\"typ-punct\">:</span> <span class=\"typ-num\">1.5pt</span> <span class=\"typ-op\">+</span> red<span class=\"typ-punct\">,</span>\n  offset<span class=\"typ-punct\">:</span> <span class=\"typ-num\">2pt</span><span class=\"typ-punct\">,</span>\n  <span class=\"typ-punct\">[</span>care<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/b5b2ca73d8986a085d842f4d70968939.png\" alt=\"Preview\"></div></div>","types":["auto","length","color","gradient","stroke","tiling","dictionary"],"strings":[],"default":"<code><span class=\"typ-key\">auto</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"offset","details":"<p>The position of the line relative to the baseline, read from the font\ntables if <code><span class=\"typ-key\">auto</span></code>.</p>","example":"<div class=\"previewed-code\"><pre><code><span class=\"typ-func\">#</span><span class=\"typ-func\">underline</span><span class=\"typ-punct\">(</span>offset<span class=\"typ-punct\">:</span> <span class=\"typ-num\">5pt</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>\n  The Tale Of A Faraway Line I\n<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/a76b54597718abe13f65b0edc33083ac.png\" alt=\"Preview\"></div></div>","types":["auto","length"],"strings":[],"default":"<code><span class=\"typ-key\">auto</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"extent","details":"<p>The amount by which to extend the line beyond (or within if negative)\nthe content.</p>","example":"<div class=\"previewed-code\"><pre><code><span class=\"typ-func\">#</span><span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>center<span class=\"typ-punct\">,</span>\n  <span class=\"typ-func\">underline</span><span class=\"typ-punct\">(</span>extent<span class=\"typ-punct\">:</span> <span class=\"typ-num\">2pt</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>Chapter 1<span class=\"typ-punct\">]</span>\n<span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/b5b4f604e2cfb5c5d6f9a9503dbf2aeb.png\" alt=\"Preview\"></div></div>","types":["length"],"strings":[],"default":"<code><span class=\"typ-num\">0pt</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"evade","details":"<p>Whether the line skips sections in which it would collide with the\nglyphs.</p>","example":"<div class=\"previewed-code\"><pre><code>This <span class=\"typ-func\">#</span><span class=\"typ-func\">underline</span><span class=\"typ-punct\">(</span>evade<span class=\"typ-punct\">:</span> <span class=\"typ-key\">true</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>is great<span class=\"typ-punct\">]</span>.\nThis <span class=\"typ-func\">#</span><span class=\"typ-func\">underline</span><span class=\"typ-punct\">(</span>evade<span class=\"typ-punct\">:</span> <span class=\"typ-key\">false</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>is less great<span class=\"typ-punct\">]</span>.\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/3da25cdaa529a21d6cf7b13a359633d1.png\" alt=\"Preview\"></div></div>","types":["bool"],"strings":[],"default":"<code><span class=\"typ-key\">true</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"background","details":"<p>Whether the line is placed behind the content it underlines.</p>","example":"<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">underline</span><span class=\"typ-punct\">(</span>stroke<span class=\"typ-punct\">:</span> <span class=\"typ-punct\">(</span>thickness<span class=\"typ-punct\">:</span> <span class=\"typ-num\">1em</span><span class=\"typ-punct\">,</span> paint<span class=\"typ-punct\">:</span> maroon<span class=\"typ-punct\">,</span> cap<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;round&quot;</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">underline</span><span class=\"typ-punct\">(</span>background<span class=\"typ-punct\">:</span> <span class=\"typ-key\">true</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>This is stylized.<span class=\"typ-punct\">]</span> <span class=\"typ-escape\">\\</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">underline</span><span class=\"typ-punct\">(</span>background<span class=\"typ-punct\">:</span> <span class=\"typ-key\">false</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>This is partially hidden.<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/5bdf0cec09671684959e5b7d8396c8b0.png\" alt=\"Preview\"></div></div>","types":["bool"],"strings":[],"default":"<code><span class=\"typ-key\">false</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"body","details":"<p>The content to underline.</p>","example":null,"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]}}}