答案1
如果你想用 TikZ 来做:
\documentclass{article}
\usepackage{tikz}
\newcommand{\microphone}{%
\tikz{
\begin{scope}
\clip (-.3em,-.4ex) rectangle (1.3em,1.5ex);
\fill[black, rounded corners=1.5ex] (-.3em,-.4ex) rectangle (1.3em,5.5ex);
\end{scope}
\fill[white, rounded corners=1.3ex] (-.1em,0) rectangle (1.1em,5.1ex);
\fill[black, rounded corners=1.1ex] (0,.2ex) rectangle (1em,5ex);
\foreach \pos in {2.5ex, 2.9ex, 3.3ex, 3.7ex}
\fill[white, rounded corners=.1ex] (.35em,\pos) rectangle +(.8em,.25ex);
\fill[black] (.4em,-.4ex) rectangle (.6em,-1.5ex);
\fill[black] (0,-1.5ex) rectangle (1em,-2ex);
}%
}
\begin{document}
{\small This is small \microphone}
This is normal \microphone
{\large This is large \microphone}
{\Huge This is Huge \microphone}
\end{document}
编辑:
根据 OP 的要求,以下是白色区域透明的版本。我创建了一个pic
既可以在宏中使用,也可以在 中使用tikzpicture
。
\documentclass{article}
\usepackage{tikz}
\tikzset{
pics/microph/.style={code={
\draw[black, line width=.2em, rounded corners=1.7ex]
(-.85em,4.5ex) -- (-.85em,2ex) -- (.85em,2ex) -- (.85em,4.5ex);
\fill[black]
(-.6em,5ex) to[rounded corners=1.2ex]
(-.6em,2.5ex) to[rounded corners=1.2ex] (.6em,2.5ex)
-- (.6em,5ex) to[rounded corners=.2ex] ++(-.85em,0) to[rounded corners=.2ex] ++(0,.35ex) -- ++(.85em,0)
-- (.6em,5.5ex) to[rounded corners=.2ex] ++(-.85em,0) to[rounded corners=.2ex] ++(0,.35ex) -- ++(.85em,0)
-- (.6em,6ex) to[rounded corners=.2ex] ++(-.85em,0) to[rounded corners=.2ex] ++(0,.35ex) -- ++(.85em,0)
-- (.6em,6.5ex) to[rounded corners=.2ex] ++(-.85em,0) to[rounded corners=.2ex] ++(0,.35ex) -- ++(.85em,0)
to[rounded corners=1.2ex]
(.6em,8ex) to[rounded corners=1.2ex]
(-.6em,8ex) to cycle;
\fill[black] (-.1em,1.8ex) rectangle (.1em,.5ex);
\fill[black] (-.5em,.5ex) rectangle (.5em,0);
}},
}
\newcommand{\microphone}{\tikz{\pic {microph};}}
\begin{document}
{\small This is small \microphone}
This is normal \microphone
{\large This is large \microphone}
{\Huge This is Huge \microphone}
And this is to show the transparency:
\begin{tikzpicture}
\fill[red] (-.5,0) rectangle (.5,1.5);
\pic {microph};
\end{tikzpicture}
\begin{tikzpicture}
\fill[green] (-.5,0) rectangle (.5,1.5);
\pic {microph};
\end{tikzpicture}
\begin{tikzpicture}
\fill[cyan] (-.5,0) rectangle (.5,1.5);
\pic {microph};
\end{tikzpicture}
\end{document}