for (var name in obj) {
this[name] = obj[name];
}
+
+ var name = this.loadedName;
+ var bold = this.black ? (this.bold ? 'bolder' : 'bold') :
+ (this.bold ? 'bold' : 'normal');
+
+ var italic = this.italic ? 'italic' : 'normal';
+ var serif = this.serif ? 'serif' : 'sans-serif';
+ var typeface = '"' + name + '", ' + serif;
+
+ this.$name1 = italic + ' ' + bold + ' ';
+ this.$name2 = 'px ' + typeface;
};
function int16(bytes) {
};
constructor.prototype = {
+ getRule: function fonts_getRule(size) {
+ return this.$name1 + size + this.$name2;
+ },
+
charsToUnicode: function fonts_chars2Unicode(chars) {
var charsCache = this.charsCache;
var str;
}
var CanvasGraphics = (function() {
- var kScalePrecision = 50;
- var kRasterizerMin = 14;
var kExecutionTime = 50;
var kExecutionTimeCheck = 500;
if (this.ctx.$setFont) {
this.ctx.$setFont(name, size);
} else {
- var bold = fontObj.black ? (fontObj.bold ? 'bolder' : 'bold') :
- (fontObj.bold ? 'bold' : 'normal');
-
- var italic = fontObj.italic ? 'italic' : 'normal';
- var serif = fontObj.serif ? 'serif' : 'sans-serif';
- var typeface = '"' + name + '", ' + serif;
- var rule = italic + ' ' + bold + ' ' + size + 'px ' + typeface;
- this.ctx.font = rule;
+ this.ctx.font = fontObj.getRule(size);
}
},
setTextRenderingMode: function(mode) {