|
@ -41,6 +41,12 @@ exports.cairoVersion = cairoVersion; |
|
|
|
|
|
|
|
|
var cache = {}; |
|
|
var cache = {}; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Text baselines. |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
var baselines = ['alphabetic', 'top', 'bottom', 'middle', 'ideographic', 'hanging']; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Font RegExp helpers. |
|
|
* Font RegExp helpers. |
|
|
*/ |
|
|
*/ |
|
@ -502,6 +508,30 @@ Context2d.prototype.__defineGetter__('font', function(){ |
|
|
return this.lastFontString || '10px sans-serif'; |
|
|
return this.lastFontString || '10px sans-serif'; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Set text baseline. |
|
|
|
|
|
* |
|
|
|
|
|
* @api public |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
Context2d.prototype.__defineSetter__('textBaseline', function(val){ |
|
|
|
|
|
var n = baselines.indexOf(val); |
|
|
|
|
|
if (~n) { |
|
|
|
|
|
this.lastBaseline = val; |
|
|
|
|
|
this.setTextBaseline(n); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the current baseline setting. |
|
|
|
|
|
* |
|
|
|
|
|
* @api public |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
Context2d.prototype.__defineGetter__('textAlign', function(){ |
|
|
|
|
|
return this.lastBaseline || 'alphabetic'; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Set text alignment. |
|
|
* Set text alignment. |
|
|
* |
|
|
* |
|
|