Mercurial > MadButterfly
diff nodejs/svg.js @ 899:ec94dd788332
set style for a text with computed text length
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Fri, 01 Oct 2010 11:10:26 +0800 |
parents | 96bc29e948cc |
children | e86b4d56ddea |
line wrap: on
line diff
--- a/nodejs/svg.js Wed Sep 29 07:42:19 2010 +0800 +++ b/nodejs/svg.js Fri Oct 01 11:10:26 2010 +0800 @@ -223,7 +223,7 @@ sz = _parse_font_size(style["font-size"]); face = this.mb_rt.font_face_query(family, 100, 210); - obj.set_style([[20, face, sz]]); + obj.set_style([[n.text().length, face, sz]]); tcoord.add_shape(obj); tcoord.set_text = tspan_set_text;