Skip to content

CSS font styling forced in gt::tab_style #2122

@thebioengineer

Description

@thebioengineer

Prework

  • Read and agree to the code of conduct and contributing guidelines.
  • If there is already a relevant issue, whether open or closed, comment on the existing thread instead of posting a new issue.
  • For any problems you identify, a minimal reproducible example so the maintainer can troubleshoot. A reproducible example is:
    • Runnable: post enough R code and data so any onlooker can create the error on their own computer.
    • Minimal: reduce runtime wherever possible and remove complicated details that are irrelevant to the issue at hand.
    • Readable: format your code according to the tidyverse style guide.

Question

What would you like to know?

https://github.com/rstudio/gt/blame/44e7f882b18850a92a5ef0a84b9c4ec93ab7d8e4/R/tab_style.R#L604-L608

this processing of adding the format passed by the user pre-supposes that the format of the font must be css compliant, which makes it so other formats must post-process the fonts passed, for example, passing a font with a space in it to word is totally fine, but this code wraps it in single quotes, which makes word not work as a viable ooxml input anymore.

> gt:::as_css_font_family_attr("My Font", value_only = TRUE)
[1] "'My Font'"

> gt:::as_css_font_family_attr("My_Font", value_only = TRUE)
[1] "My_Font"

Is there a reason to require css formatting the fonts at this step?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions