Ian*_*n G 60
事实证明,您不需要显式文本路径.Firefox 3仅部分支持垂直对齐标记(请参阅此主题).似乎显性基线仅在作为样式应用时起作用,而text-anchor可以是样式或标记属性的一部分.
<path d="M10, 20 L17, 20"
style="fill:none; color:black; stroke:black; stroke-width:1.00"/>
<text fill="black" font-family="sans-serif" font-size="16"
x="27" y="20" style="dominant-baseline: central;">
Vertical
</text>
<path d="M60, 40 L60, 47"
style="fill:none; color:red; stroke:red; stroke-width:1.00"/>
<text fill="red" font-family="sans-serif" font-size="16"
x="60" y="70" style="text-anchor: middle;">
Horizontal
</text>
<path d="M60, 90 L60, 97"
style="fill:none; color:blue; stroke:blue; stroke-width:1.00"/>
<text fill="blue" font-family="sans-serif" font-size="16"
x="60" y="97" style="text-anchor: middle; dominant-baseline: hanging;">
Bit of Both
</text>
Run Code Online (Sandbox Code Playgroud)
这适用于Firefox.不幸的是,Inkscape似乎没有处理显性基线(或者至少不是以相同的方式).