Support fontWeight in text symbolizer

This commit is contained in:
Tim Schaub
2013-10-09 11:52:00 -06:00
parent 7be90877fe
commit 2ee776d9f6
7 changed files with 112 additions and 1 deletions

View File

@@ -286,7 +286,13 @@ ol.renderer.canvas.Vector.prototype.renderText_ =
if (context.fillStyle !== text.color) {
context.fillStyle = text.color;
}
context.font = text.fontSize + 'px ' + text.fontFamily;
// font shorthand values must be given in the correct order
// see http://www.w3.org/TR/CSS21/fonts.html#font-shorthand
context.font = text.fontWeight + ' ' +
text.fontSize + 'px ' +
text.fontFamily;
context.globalAlpha = text.opacity;
// TODO: make alignments configurable