# HG changeset patch # User Thinker K.F. Li # Date 1285902626 -28800 # Node ID ec94dd788332954c5970bf81ea0b5e0b67ca0670 # Parent 6044b977ce4f2914c3aeaa9a36b5c0711dc1171f set style for a text with computed text length diff -r 6044b977ce4f -r ec94dd788332 nodejs/svg.js --- 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;