Just for the fun of it: a keyval interface to a configurable version of \dotuline.
The command is now called \ULine and you can modify:
- What is printed with the
text key. For example, you can use text={\tikz[scale=0.05]\duck;} :D
- The kern inserted before and after the
text with pre and pos
- The depth of the underline with
depth (you can tweak the depth to make an overline -- I did it with -2ex in the example with text={,})
The values can be changed locally with the optional argument to \ULine or globally with \SetULine.
Result:

Code:
\documentclass[a4paper,11pt]{article}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{xparse}
\usepackage{tikzducks}
\usepackage{tikzmarmots}
\ExplSyntaxOn
\keys_define:nn { uline } {
,text .code:n = \cs_set:Nn \uline_text: { #1 }
,pre .dim_set:N = \l_uline_kern_pre
,pre .initial:n = 0.1em
,pos .dim_set:N = \l_uline_kern_pos
,pos .initial:n = 0.04em
,depth .dim_set:N = \l_uline_depth
,depth .initial:n = 0.08ex
}
\NewDocumentCommand{\SetULine}{ m }
{ \keys_set:nn { uline } { #1 } }
\cs_new:Npn \uline_text: { . }
\NewDocumentCommand\ULine
{ o }
{
\c_group_begin_token
\IfValueT { #1 }
{ \keys_set:nn { uline } { #1 } }
\use:c { UL@setULdepth }
\markoverwith
{
\group_begin:
\dim_add:Nn \ULdepth { \l_uline_depth }
\box_move_down:nn { \ULdepth }
{
\hbox:n {
\tex_kern:D \l_uline_kern_pre \scan_stop:
\uline_text:
\tex_kern:D \l_uline_kern_pos \scan_stop:
}
}
\group_end:
}
\ULon
}
\ExplSyntaxOff
\begin{document}
\pagenumbering{gobble}
A sentence with a ........ to fill.
A sentence with a \ULine[pre=0pt,pos=0pt]{~~~~~~~} to fill.
A sentence with a \ULine[pre=0pt,pos=-0.1em]{~~~~~~~} to fill.
A sentence with a \ULine[text=\scalebox{0.7}{.},pre=0pt,pos=-0.05em]{~~~~~~~} to fill.
A sentence with a \ULine[depth=-2ex,text={,}]{~~~~~~~} to fill.
A sentence with a \ULine[text={\tikz[scale=0.05]\duck;},pre=-0.05em]{~~~~~~~} to fill.
A sentence with a \ULine[text={\tikz[scale=0.15]\marmot;},pre=-0.05em,depth=1ex]{~~~~~~~} to fill.
\end{document}