I recently ran into the same problem and found a solution that worked in my case:
After using the dominant-baseline and baseline-shift properties just to find out that both of them do not work in all the browsers I am going to support, college pointed out to me that you can use the dy attribute on the <text> element to shift it after the glyphs were located along the <textPath> .
Here are a few pseudo-codes / jsx to illustrate my solution:
<g {...}> <path id={textPathId} fill="none" transform={…} d={…} /> <text textAnchor="middle" fill={textFill} dy={shiftText} > <textPath xmlnsXlink="http://www.w3.org/1999/xlink" xlinkHref={`#${textPathId}`} startOffset="50%" > {text} </textPath> </text> </g>
Note that this depends on knowing the value of shiftText , which must be known or calculated independently. If this is not indicated, I think the only way forward is to use a combination of dominant-baseline and baseline-shift to distinguish between browsers used.
source share