Using TikZ to create a custom word which combines an svg image and text

Package scalerel could be used to scale the graphics to the size of 'f' in the current fontsize. The kerning is adjusted acc. to @Emma's suggestion.

Edit: \mbox added to prevent linebreak before hyphen and \hspace{0pt} inserted to allow linebreak after hyphen.

enter image description here

\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{newtxtext}
\usepackage{tikz}
\usetikzlibrary{svg.path}

\tikzset{
  fhole/.pic={
    \fill svg{m141.50504652572636,8.750154755020048 l12.88491,15.0039 c-6.33974,5.397 -6.91986,11.7233 -3.91811,17.7654 c2.79858,4.7279 9.39378,6.1777 14.58215,3.3698 c14.90229,-8.6016 2.97205,-29.2657 -8.32413,-35.8434 c-12.46952,-7.671 -23.48465,-2.9727 -32.06999,2.2816 c-32.57131,21.0958 -31.29905,53.0495 -36.53204,111.7787 l-3.80143,2.2686 l3.46803,2.8209 c-1.81268,50.3552 -7.19548,108.8638 -47.31312,118.9301 l-13.70647,-17.533 c6.63203,-1.8678000000000003 11.01697,-7.1683 12.24781,-13.0208 c1.58418,-12.036 -9.34214,-23.7985 -23.61721,-18.9647 c-14.27507,4.8337 -12.70367,27.7181 -1.47322,39.9927 c11.23043,12.2746 28.2174,15.8516 42.3734,10.8362 c41.92159,-16.3793 51.61678,-67.3469 52.89911,-111.1003 l3.68819,-2.1338 l-3.4807,-3.4122 c2.6751,-40.5983 -4.97189,-105.0606 32.09282,-123.0397 z};
  }
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{scalerel}
\newcommand\fhole{\mbox{\scalerel*{\tikz{\path (0,0) pic [yscale=-1] {fhole};}}{f}\hspace{-0.135em}-}\hspace{0pt}hole}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
The violin \fhole.

\footnotesize The footnotesize violin \fhole.

\huge The huge violin \fhole.

xxxxxx xxxxxx The huge violin \fhole.
\end{document}

If you are not fuzzy about the exact shape, you could produce something similar using an integral sign:

\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{newtxtext}
\usepackage{graphicx}

\usepackage{wasysym}
\newcommand\fhole{\rotatebox{-10}{\kern-0.2em$\varint$}\kern-0.2em-hole}


\begin{document}

The normalsize violin \fhole.

\footnotesize The footnotesize violin \fhole.

\huge The huge violin \fhole.

\end{document}

enter image description here

Tags:

Svg

Tikz Pgf