-
Notifications
You must be signed in to change notification settings - Fork 1.2k
the property font is not compatiable with HTML5 canvas font #566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Interesting. I posted about this here #53 (comment) but noticed bold isn't working in my case. I guess it's not supported yet? |
Yep, all options other than font-size and font-family are being ignored by node-canvas. When one specifies both font-style and font-variant, context.font gets reset to a default one: Chrome 48.0.2564.116 on OS Xcanvas v1.3.10 on OS XHere is an in-browser JSFiddle, this code attempts to auto-fit font size to fill a rectangle. |
@zwzw911, the issue with not parsing the font style correctly (especially when it includes the variant) was fixed in #891. In the meantime, I can't get I think that the "font reset" problem is fixed, so should this issue be closed now? |
I'm not sure if line-height ( |
There is no line height on canvas since there's no layout functionality in the font APIs, it just draws one line of text. It might parse OK but would be ignored. |
I think since #944 landed, this is as good as we can get. Please comment if you find any other discrepancies. |
HTML5 canvas font accept: font-style/font-variant/font-weight/font-size/font-family, for example, context.font="italic small-caps bold 12px arial", but node-canvas only accept font-style/font-size/font-family, it set font-variant or font-weight, the property font change to default value "10px sans-serfi"
The text was updated successfully, but these errors were encountered: