The bounding box of
%is not a square. Additional margins can be added to increase the frame to a square. Or the symbol can be resized. In this case the symbol is not far from a square, thus a little distorting does hurt less than different inner margins.A scale factor for the rule width adaptation is calculated by comparing the height of the symbol in normal size with the height of the symbol in the current size.
Rounded corners can easily be made with
tikz'line join=round.Shrinking and moving a box can be easily done with
\resizebox,\scaleboxand\raisebox. The dimensions of the box are available inside the arguments of these commands through\width,\height, ...Getting rid of the side bearings is the tough part, because TeX does not know the size of the side bearings. It uses only the official glyph bounding box that includes the side bearings.
LuaTeX could be tried to look into the internal font data. With some luck, the size of the side bearings can be obtained.
LuaTeX could be tried to look into the internal font data. With some luck, the size of the side bearings can be obtained.

