diff --git a/README.md b/README.md index 82395de..664da63 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# `RcppTskit`: `R` access to the `tskit C` API +# `RcppTskit`: `R` access to the `tskit C` API RcppTskit logo ## Overview @@ -11,11 +11,11 @@ described in Wong et al. (2024) <[doi:10.1093/genetics/iyae100](https://doi.org/10.1093/genetics/iyae100)>, while `tskit` project is described in Jeffrey et al. (2026) <[doi:10.48550/arXiv.2602.09649](https://doi.org/10.48550/arXiv.2602.09649)>. -See https://tskit.dev for project news, documentation, and tutorials. +See for project news, documentation, and tutorials. `Tskit` provides `Python`, `C`, and `Rust` application programming interfaces (APIs). The `Python` API can be called from `R` via the `reticulate` `R` package to seamlessly load and analyse a tree sequence, as described at -https://tskit.dev/tutorials/RcppTskit.html. +. `RcppTskit` provides `R` access to the `tskit C` API for use cases where the `reticulate` option is not optimal. For example, for high-performance and low-level work with tree sequences. @@ -54,21 +54,23 @@ Code quality: [![Codecov test coverage](https://codecov.io/gh/HighlanderLab/Rcpp -## Contents +## Repository structure - * `extern` - Git submodule for `tskit` and instructions on +* `RcppTskit` - The `R` package. + +* `extern` - Git submodule for `tskit` and instructions on obtaining the latest version and copying the `tskit C` code into `RcppTskit` directory. `extern` is saved outside of the `RcppTskit` directory because `R CMD CHECK` complains otherwise (even with `.Rbuildignore`). - * `RcppTskit` - `R` package `RcppTskit`. +* `logo` - Logo sources, variants, and reproducible generation script. ## License - * See `extern/LICENSE` for `tskit`. +* See `extern/LICENSE` for `tskit`. - * See `RcppTskit/LICENSE*` for `RcppTskit`. +* See `RcppTskit/LICENSE*` for `RcppTskit`. ## Installation @@ -104,9 +106,9 @@ Note that you will have to compile the `C/C++` code and vignette, so you will require the complete build toolchain, including compilers, other `R` packages, and `quarto`. See -https://r-pkgs.org/setup.html#setup-tools for introduction to this topic, -https://cran.r-project.org/bin/windows/Rtools for Windows tools, and -https://mac.r-project.org/tools for macOS tools. + for introduction to this topic, + for Windows tools, and + for macOS tools. ``` # install.packages("remotes") # If you don't have it already diff --git a/RcppTskit/man/figures/logo.png b/RcppTskit/man/figures/logo.png new file mode 100644 index 0000000..daea1fe Binary files /dev/null and b/RcppTskit/man/figures/logo.png differ diff --git a/logo/Makefile b/logo/Makefile new file mode 100644 index 0000000..9f1f66c --- /dev/null +++ b/logo/Makefile @@ -0,0 +1,8 @@ +.PHONY: all clean + +all: + Rscript logo.R + +clean: + $(RM) logo.svg logo.png variants/g7_hexsticker.png \ + ../RcppTskit/man/figures/logo.png diff --git a/logo/README.md b/logo/README.md new file mode 100644 index 0000000..c4731db --- /dev/null +++ b/logo/README.md @@ -0,0 +1,70 @@ +# RcppTskit logo + +## Sources + +`variants/g7-editable.svg` is the editable source for the selected wordmark. +Its `R`, `cpp`, and `T` elements are live text. Open it only on a system with +Zilla Slab Bold installed; otherwise an SVG editor may silently substitute a +different font and change the design. + +`variants/g7.svg` is the portable artwork used by the build script. Its text +has been converted to paths, so it renders consistently without an installed +font. Edit the live-text source and then regenerate this path-based version +rather than editing the letter outlines independently. + +The remaining files in `variants/` record earlier design alternatives. + +## Typeface + +The live text uses Zilla Slab Bold (weight 700), version 1.002. The exact font +file used to generate the production outlines is available from the Google +Fonts repository: + + + +Its SHA-256 checksum is: + +```text +4ec3a04a4eef37074b42ef542e4d874e13646668cfe65256e0bf100441cf8719 +``` + +Zilla Slab is distributed under the SIL Open Font License 1.1; see the +[license in Google Fonts](https://github.com/google/fonts/blob/62f61985b394df2acc8d286c45ad3bf8491698ae/ofl/zillaslab/OFL.txt). + +The `skit` lettering is retained as vector artwork from the tskit wordmark. +It is intentionally not replaced with Zilla Slab: the capital `T` is aligned +optically to the visible top and bottom of the vector `k`. + +## Editing the artwork + +1. Install the exact Zilla Slab Bold font above. +2. Open `variants/g7-editable.svg` in Inkscape and confirm that Zilla Slab Bold + is used without font substitution. +3. Select the live `R`, `cpp`, and `T` text and use **Path > Object to Path**. +4. Save the result as `variants/g7.svg`, preserving the page and group + geometry from the editable source. +5. Check the result in both Inkscape and a browser. + +## Building the final logo + +Install the required R packages once: + +```r +install.packages(c("hexSticker", "magick", "rsvg", "svglite")) +``` + +Then, from the repository root, run: + +```sh +make -C logo +``` + +The Makefile runs `logo/logo.R`, which uses `variants/g7.svg` to populate: + +- `logo/logo.svg`: canonical hexSticker composition, with the artwork embedded; +- `logo/logo.png`: high-resolution raster logo; and +- `logo/variants/g7_hexsticker.png`: copy of the final raster logo retained + with its variant name; and +- `RcppTskit/man/figures/logo.png`: 240-pixel-wide package/README logo. + +Run `make -C logo clean` to remove these generated files. diff --git a/logo/logo.R b/logo/logo.R new file mode 100644 index 0000000..97dd6b6 --- /dev/null +++ b/logo/logo.R @@ -0,0 +1,56 @@ +required_packages <- c("hexSticker", "magick", "rsvg", "svglite") +missing_packages <- required_packages[ + !vapply(required_packages, requireNamespace, logical(1), quietly = TRUE) +] +if (length(missing_packages) > 0L) { + stop( + "Install the required packages first: install.packages(c(", + paste(sprintf("\"%s\"", missing_packages), collapse = ", "), + "))" + ) +} + +artwork <- magick::image_read_svg("variants/g7.svg", height = 3000) +artwork <- magick::image_extent( + artwork, + geometry = "4000x3650", + gravity = "center", + color = "none" +) +artwork <- magick::image_extent( + artwork, + geometry = "4000x4000", + gravity = "north", + color = "none" +) +temporary_artwork <- tempfile(fileext = ".png") +magick::image_write(artwork, path = temporary_artwork, format = "png") + +hexSticker::sticker( + subplot = temporary_artwork, + package = "", + s_width = 0.82, + s_x = 1, + s_y = 0.99, + h_fill = "white", + h_color = "#045167", + h_size = 1.5, + white_around_sticker = FALSE, + dpi = 600, + filename = "logo.svg" +) +unlink(temporary_artwork) + +logo <- magick::image_read_svg("logo.svg", height = 1200) +magick::image_write(logo, path = "logo.png", format = "png") +stopifnot(file.copy("logo.png", "variants/g7_hexsticker.png", overwrite = TRUE)) + +# This is the deterministic equivalent of usethis::use_logo( +# "logo.png", geometry = "240x278", retina = TRUE +# ), without its interactive overwrite check. +package_logo <- magick::image_resize(logo, geometry = "240x278") +magick::image_write( + package_logo, + path = "../RcppTskit/man/figures/logo.png", + format = "png" +) diff --git a/logo/logo.png b/logo/logo.png new file mode 100644 index 0000000..c2e6e89 Binary files /dev/null and b/logo/logo.png differ diff --git a/logo/logo.svg b/logo/logo.svg new file mode 100644 index 0000000..2985a89 --- /dev/null +++ b/logo/logo.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logo/variants/g4.png b/logo/variants/g4.png new file mode 100644 index 0000000..279cff1 Binary files /dev/null and b/logo/variants/g4.png differ diff --git a/logo/variants/g4.svg b/logo/variants/g4.svg new file mode 100644 index 0000000..cac72a7 --- /dev/null +++ b/logo/variants/g4.svg @@ -0,0 +1,159 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logo/variants/g4_hexsticker.png b/logo/variants/g4_hexsticker.png new file mode 100644 index 0000000..0e8213a Binary files /dev/null and b/logo/variants/g4_hexsticker.png differ diff --git a/logo/variants/g5.png b/logo/variants/g5.png new file mode 100644 index 0000000..dc999e6 Binary files /dev/null and b/logo/variants/g5.png differ diff --git a/logo/variants/g5.svg b/logo/variants/g5.svg new file mode 100644 index 0000000..a76806b --- /dev/null +++ b/logo/variants/g5.svg @@ -0,0 +1,117 @@ + + + +cppRT diff --git a/logo/variants/g5_hexsticker.png b/logo/variants/g5_hexsticker.png new file mode 100644 index 0000000..594f2e4 Binary files /dev/null and b/logo/variants/g5_hexsticker.png differ diff --git a/logo/variants/g6.png b/logo/variants/g6.png new file mode 100644 index 0000000..092a584 Binary files /dev/null and b/logo/variants/g6.png differ diff --git a/logo/variants/g6.svg b/logo/variants/g6.svg new file mode 100644 index 0000000..48f693d --- /dev/null +++ b/logo/variants/g6.svg @@ -0,0 +1,150 @@ + + + +cppRT diff --git a/logo/variants/g6_hexsticker.png b/logo/variants/g6_hexsticker.png new file mode 100644 index 0000000..af128f3 Binary files /dev/null and b/logo/variants/g6_hexsticker.png differ diff --git a/logo/variants/g7-editable.svg b/logo/variants/g7-editable.svg new file mode 100644 index 0000000..9616693 --- /dev/null +++ b/logo/variants/g7-editable.svg @@ -0,0 +1,63 @@ + + + Editable RcppTskit logo source. Live text requires Zilla Slab Bold 700, version 1.002; see ../README.md for the pinned font source, checksum, and reproduction instructions. + + cpp + R + + + T + + + + + + + + + + + + + + + + + + + + + diff --git a/logo/variants/g7.png b/logo/variants/g7.png new file mode 100644 index 0000000..ed3f8c1 Binary files /dev/null and b/logo/variants/g7.png differ diff --git a/logo/variants/g7.svg b/logo/variants/g7.svg new file mode 100644 index 0000000..f11220c --- /dev/null +++ b/logo/variants/g7.svg @@ -0,0 +1,135 @@ + + + +Production RcppTskit logo. The Zilla Slab Bold text has been converted to paths; see ../README.md and g7-editable.svg for the editable source and font provenance. diff --git a/logo/variants/g7_hexsticker.png b/logo/variants/g7_hexsticker.png new file mode 100644 index 0000000..c2e6e89 Binary files /dev/null and b/logo/variants/g7_hexsticker.png differ