PDA

View Full Version : [CLOSED]Ext.draw.Sprite type: 'text' - can't set up a text style



vega109
11 Apr 2011, 1:42 PM
Hello

I create a draw component with a text sprite inside. It display me wrong font style and size ignoring configured 'font' parameter.

Also is it possible to break a text in several lines?


new Ext.draw.Component({
floating : true,
renderTo : 'draw-component',
id : 'win' + counter,
width : 200,
height : 200,
frame : false,
draggable : true,
resizable : false,
x : x,
y : y,
items : [ {
type : 'text',
text : notes,
fill : '#000',
font : '12px Arial'
} ]
}).show();

steffenk
11 Apr 2011, 1:47 PM
it should work - you have an error with text property, quote it!

text : 'notes',

These are the supported text attributes:


text: {
x: 0,
y: 0,
"text-anchor": "start",
"font-family": null,
"font-size": null,
"font-weight": null,
"font-style": null,
fill: "#000",
stroke: null,
"stroke-width": null,
opacity: null,
"fill-opacity": null,
"stroke-opacity": null
},

vega109
11 Apr 2011, 4:00 PM
Thanks for the description but styles still don't apply to the text and I still can't break one long line to several short lines.

steffenk
12 Apr 2011, 12:12 AM
works for me


text: 'Is a snap!' + "\n" + 'second row'

sure there is no automatic, but you could split up yourself programatically.