Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ knitr::opts_chunk$set(
)
```

# deli
# deli <a href="https://r-causal.github.io/deli"><img src="man/figures/logo.png" align="right" height="138" alt="deli website" /></a>

<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# deli
# deli <a href="https://r-causal.github.io/deli"><img src="man/figures/logo.png" align="right" height="138" alt="deli website" /></a>

<!-- badges: start -->

Expand Down
1 change: 1 addition & 0 deletions data-raw/logo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exports/
13 changes: 13 additions & 0 deletions data-raw/logo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Package logo

The text-free artwork was generated with the built-in image-generation tool.
`prompt.txt` records the artwork prompt. `sticker.svg` adds editable typography
and a border clipped to the 1.74 by 2 inch hexagon.

Run `Rscript data-raw/logo/build.R` from the package root to export a 600 dpi
print PNG and an SVG with outlined text to `exports/`, then install the README
logo with `usethis::use_logo()`.

The build requires the R packages base64enc, magick, rsvg, systemfonts, and
usethis, plus Gill Sans and STIX Two Math installed locally.
The artwork, fonts, and print tools are not package runtime dependencies.
Binary file added data-raw/logo/artwork.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions data-raw/logo/build.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Run from the package root: Rscript data-raw/logo/build.R
args <- commandArgs(trailingOnly = FALSE)
script <- sub("^--file=", "", args[grepl("^--file=", args)])
source_dir <- dirname(normalizePath(script))
root <- normalizePath(file.path(source_dir, "../.."))
svg <- paste(readLines(file.path(source_dir, "sticker.svg")), collapse = "\n")
families <- regmatches(svg, gregexpr('font-family="[^"]+"', svg))[[1]]
families <- unique(sub('font-family="([^"]+)"', "\\1", families))
missing <- setdiff(families, systemfonts::system_fonts()$family)
if (length(missing)) {
stop(
"Install the source fonts before rebuilding: ",
paste(missing, collapse = ", ")
)
}
art <- base64enc::dataURI(
file = file.path(source_dir, "artwork.png"),
mime = "image/png"
)
svg <- sub("artwork.png", art, svg, fixed = TRUE)
exports <- file.path(source_dir, "exports")
dir.create(exports, showWarnings = FALSE)
print_png <- file.path(exports, "logo.png")
raster <- rsvg::rsvg_png(charToRaw(svg), width = 1044, height = 1200)
magick::image_write(
magick::image_read(raster),
path = print_png,
format = "png",
density = "600x600"
)

# Outline the text separately to avoid resampling the embedded artwork.
text_only <- gsub("<image[^>]*/>", "", svg)
text_only <- gsub("<rect[^>]*/>", "", text_only)
text_only <- gsub('<polygon id="sticker-border"[^>]*/>', "", text_only)
print_svg <- file.path(exports, "logo.svg")
rsvg::rsvg_svg(charToRaw(text_only), print_svg, width = 1740, height = 2000)
outlined <- paste(readLines(print_svg), collapse = "\n")
inner <- sub("(?s).*?<svg[^>]*>", "", outlined, perl = TRUE)
inner <- sub("</svg>\\s*$", "", inner, perl = TRUE)
without_text <- gsub("(?s)<text[^>]*>.*?</text>", "", svg, perl = TRUE)
combined <- sub("</svg>", paste0(inner, "</svg>"), without_text, fixed = TRUE)
stopifnot(!grepl("<text[ >]", combined))
writeLines(combined, print_svg)

usethis::proj_set(root)
options(usethis.overwrite = TRUE)
usethis::use_logo(print_png)
1 change: 1 addition & 0 deletions data-raw/logo/prompt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use case: precise-object-edit. Edit ONLY the central shop display window of this exact neighborhood deli illustration. Remove the large cream sandwich silhouette from the dark blue window. Replace its area with a clean quiet dark navy painted glass surface matching the surrounding window, with subtle existing printmaking grain and faint reflections. Leave this central glass area EMPTY, ready for a designer to add real mathematical window lettering later. Preserve the two hanging lights and window frame, all architectural geometry, red and cream striped awning, blank upper shop sign, ochre door, brickwork, pots, plants, original warm cream paper background and lower empty margin exactly. Do NOT add any replacement graphic, letters, mathematical notation, numbers, symbols or pseudo-writing anywhere. Do not change the storefront design, proportions, colors or framing. This is only removal of the sandwich logo with matching blank glass beneath it. Keep original portrait 3:4 composition.
7 changes: 7 additions & 0 deletions data-raw/logo/sticker.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions pkgdown/favicon/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions pkgdown/favicon/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/web-app-manifest-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/web-app-manifest-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
Binary file added pkgdown/favicon/web-app-manifest-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/web-app-manifest-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading