Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Hovering over point changes the legend fontStyle when set to 'semibold' #3318
@elliottregan the issue here is that 'semibold' doesn't seem to be recognized by the canvas and so setting the font silently fails.
https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight indicates that setting a font weight of '600' is equivalent to semi-bold but I cannot detect a difference between 600 & 800 (bold).
The docs on the canvas rendering context font property https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font just say that it should be a valid CSS font string which we have but the canvas doesn't like it.
For reference, the font is set
ctx.font = "semibold 20px 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"
Maybe we can detect this case after setting by comparing
I looked into this more. The problem here is that, the system has no semibold Helvetica Neue font so it's not applied to the canvas rendering context when we set it.
I thought about filing a Chrome issue for this, but the behaviour is the same as for the CSS
Test case: https://jsfiddle.net/6zqcsph9/
Recommendation: close as not a bug