Skip to content
Merged

Logo #146

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
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `RcppTskit`: `R` access to the `tskit C` API
# `RcppTskit`: `R` access to the `tskit C` API <img src="RcppTskit/man/figures/logo.png" align="right" height="139" alt="RcppTskit logo" />

## Overview

Expand All @@ -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 <https://tskit.dev> 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.
<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.
Expand Down Expand Up @@ -54,21 +54,23 @@ Code quality: [![Codecov test coverage](https://codecov.io/gh/HighlanderLab/Rcpp

<!-- badges: end -->

## 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

Expand Down Expand Up @@ -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.
<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.

```
# install.packages("remotes") # If you don't have it already
Expand Down
Binary file added RcppTskit/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.
8 changes: 8 additions & 0 deletions logo/Makefile
Original file line number Diff line number Diff line change
@@ -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
70 changes: 70 additions & 0 deletions logo/README.md
Original file line number Diff line number Diff line change
@@ -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:

<https://raw.githubusercontent.com/google/fonts/62f61985b394df2acc8d286c45ad3bf8491698ae/ofl/zillaslab/ZillaSlab-Bold.ttf>

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.
56 changes: 56 additions & 0 deletions logo/logo.R
Original file line number Diff line number Diff line change
@@ -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"
)
Binary file added logo/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions logo/logo.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 logo/variants/g4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
159 changes: 159 additions & 0 deletions logo/variants/g4.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 logo/variants/g4_hexsticker.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 logo/variants/g5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading