| 1698 |
}; |
}; |
| 1699 |
|
|
| 1700 |
Label.prototype.setFontSize = function (size) { |
Label.prototype.setFontSize = function (size) { |
| 1701 |
var font = this.getFont(); |
var dom = document.createElement("div"); |
| 1702 |
var firstPos = font.indexOf(" "); |
dom.style.font = this.getFont(); |
| 1703 |
this.setFont(size + "px " + font.substr(firstPos + 1)); |
dom.style.fontSize = size + "px"; |
| 1704 |
|
this.setFont(dom.style.font); |
| 1705 |
}; |
}; |
| 1706 |
|
|
| 1707 |
Label.prototype.getFontSize = function () { |
Label.prototype.getFontSize = function () { |
| 1708 |
var font = this.getFont(); |
var dom = document.createElement("div"); |
| 1709 |
var firstPos = font.indexOf(" "); |
dom.style.font = this.getFont(); |
| 1710 |
try { |
return Number(dom.style.fontSize.substr(0, dom.style.fontSize.length - 2)); |
| 1711 |
return parseInt(font.substr(0, firstPos - 2)); |
}; |
| 1712 |
} catch (ex) { |
|
| 1713 |
} |
Label.prototype.getFontFamily = function () { |
| 1714 |
return this.height; |
var dom = document.createElement("div"); |
| 1715 |
|
dom.style.font = this.getFont(); |
| 1716 |
|
return dom.style.fontFamily; |
| 1717 |
|
}; |
| 1718 |
|
|
| 1719 |
|
Label.prototype.setFontFamily = function (family) { |
| 1720 |
|
var dom = document.createElement("div"); |
| 1721 |
|
dom.style.font = this.getFont(); |
| 1722 |
|
dom.style.fontFamily = family; |
| 1723 |
|
this.setFont(dom.style.font); |
| 1724 |
}; |
}; |
| 1725 |
|
|
| 1726 |
Label.prototype.setTextAlign = function (align) { |
Label.prototype.setTextAlign = function (align) { |