スペースバーからのスペースを含め、ラファエルが生成したテキストの幅を取得したいと思います。しかし、私はそれを見つけます
text=Canvas.paper.text(wordPos, linePos, word).attr({"font-size": fontSize,
"font-weight":TextParams.fontWeight, "fill":TextParams.color, "text-anchor":"start"});
console.log('text.getBBox().width (w/o space)='+text.getBBox().width);
word+=' ';
text=Canvas.paper.text(wordPos, linePos, word).attr({"font-size": fontSize,
"font-weight":TextParams.fontWeight, "fill":TextParams.color, "text-anchor":"start"});
console.log('text.getBBox().width (with space)='+text.getBBox().width);
戻り値
text.getBBox().width (w/o space)=51.125
text.getBBox().width (with space)=51.125
スペースを含むテキストの幅を取得する方法はありますか?