काम नहीं कर रहा fontweight,कपड़े js <code>fabric js</code> का उपयोग कर <code>canvas</code> में मैं <code>textbox</code> जोड़ने के लिए इस कोड का उपयोग कर रहा
var text = 'Type Text Here';
var textSample = new fabric.Textbox(text, {
left: getCardLeft() + 100,
top: getCardTop() + 10,
width: 200,
height: 20,
fontFamily: 'Helvetica',
fill: getColorPickerForegroundColor(),
fontWeight: '',
fontSize: parseInt('25'),
originX: 'center',
hasRotatingPoint: true,
centerTransform: true,
});
canvas.add(textSample);
जो सफलतापूर्वक canvas
में textbox
जोड़ें। अब, मैं इस आदेश
canvas.getActiveObject().set("fontWeight", "bold");
canvas.renderAll();
कार्य का उपयोग कर इसे bold
बनाने की कोशिश, लेकिन जब कोशिश सामान्य करने के लिए इसे बदलने के लिए,
canvas.getActiveObject().set("fontWeight", "");
canvas.getActiveObject().set("fontWeight", "100");
canvas.getActiveObject().set("fontWeight", "normal");
canvas.renderAll();
काम नहीं कर रहा है।
मुझे नहीं पता कि समस्या कहां है। क्या मैं यहाँ कुछ गलत कर रहा हूँ?
यह अजीब व्यवहार कर रहा है आप इसे here देख सकते हैं।
मैंने पहले से ही अपने कोड में प्रस्तुत किया है। लेकिन यह अजीब व्यवहार कर रहा है। http://screencast.com/t/HDVH6ckkr – hemsbhardiya
मैंने अभी अपना प्रश्न थोड़ा संपादित किया है, कृपया इसे दोबारा देखें। क्या आपको कुछ भी गलत हो सकता है जिसे मैं नहीं ढूंढ पाया। धन्यवाद – hemsbhardiya