答案1
\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\node (n) {13};
\draw let \p1=(n.east), \p2=(n.center), \n1={veclen(\x2-\x1,\y2-\y1)} in (\p1) arc[radius=\n1, start angle=0, end angle=270] -| cycle;
\end{tikzpicture}
\end{document}
编辑:与基线对齐
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand{\framed}[1]{%
\begin{tikzpicture}[baseline]
\node[anchor=base] (n) {#1};
\draw let \p1=(n.east), \p2=(n.center), \n1={veclen(\x2-\x1,\y2-\y1)} in (\p1) arc[radius=\n1, start angle=0, end angle=270] -| cycle;
\end{tikzpicture}}
\begin{document}
Normal $13$ and framed \framed{$13$}
\end{document}