I confronted a similar problem with a need for a pretty bar over various characters with \mathbf, \mathcal, \mathfrak, etc. By "pretty," I mean that the bar seems very appropriate to the character shape and size, and this means adjusting the length and placement (left and right offsets) until it looks right. Further, the commands used must be compatible with MathJax in HTML after the TeX file is converted to XML for conversion to HTML on the Springer website.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Program for "manually" adjusting the bar over capital letters %
% or any other character to put a bar over. You specify the %
% character and two offset lengths. The program calculates the %
% the bar length such that the character with a bar has the same %
% same length as the character without a bar. %
% %
% Specify the character and initial offsets below. Produce a pdf %
% and zoom in to see the barred character full screen. Return to %
% the TeX file and change the offsets until you are happy with %
% with the resulting appearance. Then zoom out with the pdf viewer %
% and copy the command for pasting wherever you want to save it. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[letterpaper]{article}
\usepackage[vmargin=0.25in]{geometry}
\usepackage[tbtags]{amsmath}
\usepackage{amsfonts,amssymb}
\usepackage{calc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% If you want to use a character from another font (e.g., Euler) %
% then add the needed package above. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newlength{\charlength}
\newlength{\leftoffset}
\newlength{\rightoffset}
\newlength{\overlength}
\newlength{\backlength} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% User settings %
\newcommand{\testchar}{\mathcal{S}} % Set the character you want %
\newcommand{\printchar}{\textbackslash mathcal\{S\}}% twice, slightly different. %
\setlength{\leftoffset}{0.71pt} % Set the left offset and the %
\setlength{\rightoffset}{0.71pt} % right offset for the bar. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\settowidth{\charlength}{$\testchar$}
\setlength{\overlength}{\charlength - \leftoffset - \rightoffset}
\setlength{\backlength}{\charlength - \rightoffset}
\pagestyle{empty}
\begin{document}
\vspace*{25mm}
$\overset{\kern\leftoffset\underline{\kern\overlength}\kern\rightoffset}{\testchar}$
$\text{\textbackslash overset\{\textbackslash kern\the\leftoffset\textbackslash underline\{\textbackslash kern\the\overlength\}\textbackslash kern\the\rightoffset\}\{\printchar\}}$
\bigskip
$\kern\leftoffset\overline{\vphantom{\testchar}\kern\overlength}\kern-\backlength\testchar$
$\text{\textbackslash kern\the\leftoffset\textbackslash overline\{\textbackslash vphantom\{\printchar\}\textbackslash kern\the\overlength\}\textbackslash kern--\the\backlength\printchar}$
\end{document}
One drawback is that you must the character you want in the program twice in slightly different ways. For example, if you want a nice bar on \mathfrak{C},
then in the program, which is now set for \mathcal{S}, you must change S => C twice and change cal => frak twice.
But the payback for the double effort is that you get the command to save or put into another TeX file by copying the command from the pdf in your reader (I use SumatraPDF because the pdf file stays open in the reader while I change the TeX, and when I make the new pdf in WinEdt, it transfers me back to reader looking at the changed pdf in exactly the same place, etc., as when I left it to edit the TeX file).
The program gives two variants: with \overset and with \overline of a phantom. The separation from the character with \overset is about 20% greater than the separation with \overline. On my screen with the so-called \widebar{\mathcal{S}} occupying the full 23.5 cm height of the reader view, the separation is 3 cm for \overset and 2.5 cm for \overline.
Suppose you have adjusted the left and right offsets for a pretty \barfrakC, but you now need a double bar. What to do?
Copy the line \newcommand\barfrakC{...} and paste it in the TeX file, change the \mathfrak{C} test character (and print character) to \barfrakC, and so on to get what you need to paste into \newcommand\dbarfrakC{}.