Gt: Font weight not accepted when numeric

Created on 19 May 2020  Â·  1Comment  Â·  Source: rstudio/gt

cell_text() seems not to accept numeric values for weight (although the docs say it can). I understand that this doesn't apply to every font, but it seems like it's not getting passed the validation of the argument to begin with.

library(gt)
cell_text(weight = 400)
#> Error: The provided `weight` value cannot be `400`; it can only be either of the following:
#>  * `"normal"`, `"bold"`, `"lighter"`, or `"bolder"`

Created on 2020-05-19 by the reprex package (v0.3.0)

[2] Intermediate [2] Medium [3] High ★ Enhancement

Most helpful comment

Thanks for reporting this. There used to be the option to include the font-weight numbers but it was removed. This should be put back in, especially since some work is being done to include web fonts, most of which have quite a few weights.

>All comments

Thanks for reporting this. There used to be the option to include the font-weight numbers but it was removed. This should be put back in, especially since some work is being done to include web fonts, most of which have quite a few weights.

Was this page helpful?
0 / 5 - 0 ratings