Skip to content

Commit 2568789

Browse files
committed
add italic/fontweight/fontwidth properties (tidyverse#6458)
1 parent 4fa54e7 commit 2568789

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

R/theme-elements.R

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ element_props <- list(
110110
arrow = property_nullable(S7::new_S3_class("arrow") | S7::class_logical),
111111
arrow.fill = property_nullable(S7::class_character | S7::class_logical),
112112
debug = property_boolean(allow_null = TRUE, default = NULL),
113-
inherit.blank = property_boolean(default = FALSE)
113+
inherit.blank = property_boolean(default = FALSE),
114+
# These are reserved for future use
115+
italic = property_nullable(S7::class_character),
116+
fontweight = property_nullable(S7::class_numeric),
117+
fontwidth = property_nullable(S7::class_numeric | S7::class_character)
114118
)
115119

116120
#' @export
@@ -193,7 +197,8 @@ element_line <- S7::new_class(
193197
element_text <- S7::new_class(
194198
"element_text", parent = element,
195199
properties = element_props[c(
196-
"family", "face", "colour", "size", "hjust", "vjust", "angle", "lineheight",
200+
"family", "face", "italic", "fontweight", "fontwidth",
201+
"colour", "size", "hjust", "vjust", "angle", "lineheight",
197202
"margin", "debug", "inherit.blank"
198203
)],
199204
constructor = function(family = NULL, face = NULL, colour = NULL,
@@ -216,7 +221,8 @@ element_text <- S7::new_class(
216221
S7::S7_object(),
217222
family = family, face = face, colour = colour, size = size,
218223
hjust = hjust, vjust = vjust, angle = angle, lineheight = lineheight,
219-
margin = margin, debug = debug, inherit.blank = inherit.blank
224+
margin = margin, debug = debug, inherit.blank = inherit.blank,
225+
italic = NA_character_, fontweight = NA_real_, fontwidth = NA_real_
220226
)
221227
}
222228
)

0 commit comments

Comments
 (0)