var tags = new Array;
var text = node.attrs['text'].split('\n');
- Roo.log(text);
- map(node.attrs['text'].split('\n'), function (text, iterable, line) {
- line = line || 0;
- tags.push(tag(
- 'text',
- reduce(
- node.attrs,
- function (initial, value, name) {
- if (name !== 'text' && name !== 'w' && name !== 'h') {
- if (name === 'font-size')
- value = value + 'px';
-
- initial[name] = escapeXML(value.toString());
- }
-
- return initial;
- },
- {
- style: 'text-anchor: ' + (style.font.anchor ? (style.font.anchor + ';') : 'middle;') +
- styleToString(style) + ';'
- }
- ),
- node.matrix,
- tag('tspan',
- {
- dy: computeTSpanDy(style.font.size, line + 1, node.attrs['text'].split('\n').length)
- },
- null,
- escapeXML(text)
- )
- ));
- });
+
+ tags.push(tag(
+ 'text',
+ reduce(
+ node.attrs,
+ function (initial, value, name) {
+ if (name !== 'text' && name !== 'w' && name !== 'h') {
+ if (name === 'font-size')
+ value = value + 'px';
+
+ initial[name] = escapeXML(value.toString());
+ }
+
+ return initial;
+ },
+ {
+ style: 'text-anchor: ' + (style.font.anchor ? (style.font.anchor + ';') : 'middle;') +
+ styleToString(style) + ';'
+ }
+ ),
+ node.matrix,
+ tag('tspan',
+ {
+ dy: computeTSpanDy(style.font.size, line + 1, node.attrs['text'].split('\n').length)
+ },
+ null,
+ escapeXML(text)
+ )
+ ));
+
+// map(node.attrs['text'].split('\n'), function (text, iterable, line) {
+// line = line || 0;
+// tags.push(tag(
+// 'text',
+// reduce(
+// node.attrs,
+// function (initial, value, name) {
+// if (name !== 'text' && name !== 'w' && name !== 'h') {
+// if (name === 'font-size')
+// value = value + 'px';
+//
+// initial[name] = escapeXML(value.toString());
+// }
+//
+// return initial;
+// },
+// {
+// style: 'text-anchor: ' + (style.font.anchor ? (style.font.anchor + ';') : 'middle;') +
+// styleToString(style) + ';'
+// }
+// ),
+// node.matrix,
+// tag('tspan',
+// {
+// dy: computeTSpanDy(style.font.size, line + 1, node.attrs['text'].split('\n').length)
+// },
+// null,
+// escapeXML(text)
+// )
+// ));
+// });
return tags;
},