Skip to content

Allow font-family to be inherited if font.family is set to empty #678

@zeripath

Description

@zeripath

I'm unsure whether this would work in all output formats, but it would be good to not have to set the font-family explicitly for flextable and instead just inherit directly from the css/styling outside of the flextable.

I propose, that either, one sets the font.family to "" (or NA) and then in runs_as_functions.R change:

family <- sprintf("font-family:'%s';", x$font.family)

to simply detect if it's "", e.g.:

family <- ""
if (x$font.family != "") {
  family <- sprintf("font-family:'%s';", x$font.family) 
}

or for NA:

family <- ""
if (!is.na(x$font.family) {
  family <- sprintf("font-family:'%s';", x$font.family) 
}

AFAIC The font-family should then simply be inherited from the rest of the document.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions