changeset 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 6044b977ce4f
children f4fd7a16361d
files nodejs/svg.js
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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;