Mercurial > MadButterfly
comparison 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 |
comparison
equal
deleted
inserted
replaced
898:6044b977ce4f | 899:ec94dd788332 |
---|---|
221 family = style["font-family"]; | 221 family = style["font-family"]; |
222 if("font-size" in style) | 222 if("font-size" in style) |
223 sz = _parse_font_size(style["font-size"]); | 223 sz = _parse_font_size(style["font-size"]); |
224 | 224 |
225 face = this.mb_rt.font_face_query(family, 100, 210); | 225 face = this.mb_rt.font_face_query(family, 100, 210); |
226 obj.set_style([[20, face, sz]]); | 226 obj.set_style([[n.text().length, face, sz]]); |
227 | 227 |
228 tcoord.add_shape(obj); | 228 tcoord.add_shape(obj); |
229 tcoord.set_text = tspan_set_text; | 229 tcoord.set_text = tspan_set_text; |
230 tcoord.text = obj; | 230 tcoord.text = obj; |
231 | 231 |