From b6ab26522d21da423ea9b232579c0f81fc015a77 Mon Sep 17 00:00:00 2001 From: munoztd0 Date: Thu, 5 Mar 2026 11:02:14 +0100 Subject: [PATCH 1/3] update: adding one extra space to every spanned cell --- R/tostring.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tostring.R b/R/tostring.R index cea31f0e..6f9980ad 100644 --- a/R/tostring.R +++ b/R/tostring.R @@ -271,7 +271,7 @@ set_default_hsep <- function(hsep_char) { nj <- spans[i, j] j <- if (nj > 1) { js <- seq(j, j + nj - 1) - cell_widths_mat[i, js] <- sum(cell_widths_mat[i, js]) + col_gap * (nj - 1) + cell_widths_mat[i, js] <- sum(cell_widths_mat[i, js]) + col_gap * (nj - 1) + 1 j + nj } else { j + 1 From 166bd3e826950693cb85cb59fd38cdb8612867b7 Mon Sep 17 00:00:00 2001 From: munoztd0 Date: Thu, 5 Mar 2026 11:09:31 +0100 Subject: [PATCH 2/3] update: messing up colwidth --- R/mpf_exporters.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/mpf_exporters.R b/R/mpf_exporters.R index 873787f4..ec9da77a 100644 --- a/R/mpf_exporters.R +++ b/R/mpf_exporters.R @@ -276,7 +276,7 @@ mpf_to_rtf <- function(mpf, } rtfpg <- r2rtf::rtf_body(rtfpg, - col_rel_width = colwidths, + col_rel_width = colwidths + 0.5, text_justification = c("l", rep("c", ncol(myfakedf) - 1)), text_format = "", text_font = 9, From 9ae8b1d958a1c67963d8baf857bea8e7c1d977a6 Mon Sep 17 00:00:00 2001 From: munoztd0 Date: Thu, 5 Mar 2026 11:18:02 +0100 Subject: [PATCH 3/3] update: messing up colwidth in wrap_string_ttype --- R/tostring.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tostring.R b/R/tostring.R index 6f9980ad..5b6ba84d 100644 --- a/R/tostring.R +++ b/R/tostring.R @@ -1166,7 +1166,7 @@ wrap_string_ttype <- function(str, rawspls <- strsplit(str, "[[:space:]](?=[^[:space:]])", perl = TRUE)[[1]] # preserve all but one space nctt <- nchar_ttype(rawspls, fontspec, raw = TRUE) - pts <- which(cumsum(nctt) <= width) + pts <- which(cumsum(nctt) <= width -5) if (length(pts) == length(rawspls)) { ## no splitting needed return(str) } else if (length(pts) == 0) { ## no spaces, all one word, split it and keep going