SVG.<text/>文字的长度

1、SVGTextElement.getBBox() ==> 然后得到 宽 和 高

2、SVGTextElement.getComputedTextLength() ==> 这个是得到 宽 的函数,貌似没有得到 高 的函数...(我把 SVGTextElement 的所有属性都打印出来了,貌似也没找到对应的计算高的函数)

 

3、

参考网址:

  https://stackoverflow.com/questions/10254644/get-pixel-length-of-string-in-svg

  https://stackoverflow.com/questions/1636842/svg-get-text-element-width

 

4、

5、

 

posted @ 2017-12-12 14:44  Html5Skill  阅读(3442)  评论(0编辑  收藏  举报