font style support for feature label. r=erilem (closes #3051)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11744 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2011-03-29 09:54:00 +00:00
parent 222162fa98
commit 33d330c0db
6 changed files with 18 additions and 3 deletions

View File

@@ -333,7 +333,11 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
this.setCanvasStyle("reset");
this.canvas.fillStyle = style.fontColor;
this.canvas.globalAlpha = style.fontOpacity || 1.0;
var fontStyle = style.fontWeight + " " + style.fontSize + " " + style.fontFamily;
var fontStyle = [style.fontStyle ? style.fontStyle : "normal",
"normal", // "font-variant" not supported
style.fontWeight ? style.fontWeight : "normal",
style.fontSize ? style.fontSize : "10px",
style.fontFamily ? style.fontFamily : "sans-serif"].join(" ");
if (this.canvas.fillText) {
// HTML5
var labelAlign =