Skip to content

Commit

Permalink
Merge pull request #73 from OxfordIHTM/dev
Browse files Browse the repository at this point in the history
create fonts vignette
  • Loading branch information
ernestguevarra authored Mar 17, 2024
2 parents a2895a1 + efe2eda commit 81ee556
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 19 deletions.
2 changes: 2 additions & 0 deletions R/oxford_theme_forest.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#' @examples
#' theme_oxford_forest()
#'
#' @author Ernest Guevarra and Greco Malijan
#'
#' @rdname theme_forest
#' @export
#'
Expand Down
File renamed without changes.
13 changes: 6 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ knitr::opts_chunk$set(
comment = "#>",
fig.path = "man/figures/README-"
)
library(oxthema)
library(ggplot2)
requireNamespace("sf", quietly = TRUE)
```

# oxthema: Oxford Palette, Theme, and Theme Components <img src="man/figures/logo.png" width="200" align="right" />
Expand All @@ -35,7 +30,7 @@ Palette, theme, and theme components based on [University of Oxford](https://ox.

`oxthema` aims to provide templates, themes, and theme components for colour palettes, typography, and layout compliant with [University of Oxford](https://ox.ac.uk)'s [visual identity guidelines](https://communications.web.ox.ac.uk/communications-resources/visual-identity/identity-guidelines) for use in the R language for statistical computing graphics and publishing ecosystem.

Currently, the package provides colour palettes consistent with the colours prescribed by the university visual identity guidelines. Additional templates, themes, and theme components will be included over time.
The package provides colours, palettes, and fonts consistent with the university visual identity guidelines. The package also includes themes for specific packages and functionalities that make use of colours, palettes, and fonts. The package currently has themes for `ggplot2` and for `forestploter` packages.

## Installation

Expand All @@ -59,7 +54,11 @@ The following vignettes provide details on how to make full use of the `oxthema`

* [Oxford palettes](https://oxford-ihtm.io/oxthema/articles/oxford-palettes.html)

* [Oxford theme](https://oxford-ihtm.io/oxthema/articles/oxford-theme.html)
* [Oxford fonts](https://oxford-ihtm.io/oxthema/articles/oxford-fonts.html)

* [Oxford ggplot2 themes](https://oxford-ihtm.io/oxthema/articles/oxford-ggplot2-theme.html)

* [Oxford forestploter themes](https://oxford-ihtm.io/oxthema/articles/oxford-forestploter-themes.html)


## Authors
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ guidelines](https://communications.web.ox.ac.uk/communications-resources/visual-
for use in the R language for statistical computing graphics and
publishing ecosystem.

Currently, the package provides colour palettes consistent with the
colours prescribed by the university visual identity guidelines.
Additional templates, themes, and theme components will be included over
time.
The package provides colours, palettes, and fonts consistent with the
university visual identity guidelines. The package also includes themes
for specific packages and functionalities that make use of colours,
palettes, and fonts. The package currently has themes for `ggplot2` and
for `forestploter` packages.

## Installation

Expand Down Expand Up @@ -64,7 +65,13 @@ The following vignettes provide details on how to make full use of the
palettes](https://oxford-ihtm.io/oxthema/articles/oxford-palettes.html)

- [Oxford
theme](https://oxford-ihtm.io/oxthema/articles/oxford-theme.html)
fonts](https://oxford-ihtm.io/oxthema/articles/oxford-fonts.html)

- [Oxford ggplot2
themes](https://oxford-ihtm.io/oxthema/articles/oxford-ggplot2-theme.html)

- [Oxford forestploter
themes](https://oxford-ihtm.io/oxthema/articles/oxford-forestploter-themes.html)

## Authors

Expand Down
4 changes: 4 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
Bebas
CMD
CodeFactor
Codecov
ColorBrewer
IHTM
Lifecycle
MUAC
Neue
Noto
Pantone
Phudu
RColorBrewer
Roboto
Rudis
Expand Down
2 changes: 1 addition & 1 deletion man/oxford_theme.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/theme_forest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions vignettes/oxford-fonts.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: "Oxford Fonts"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Oxford Fonts}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

```{r setup, echo = FALSE}
library(oxthema)
```

The `oxthema` package uses the fonts prescribed by Oxford's visual identity guidelines.

## Core fonts

The core University fonts are *Roboto* (san serif font) and *Noto Serif* (serif font). These fonts are installed in all managed staff desktop (CONNECT and Orchard) machines. Hence, they should be readily available when using R from these machines. Also, both are Google fonts and as such are downloadable from the [Google Fonts website](https://fonts.google.com/).

## Complementary display fonts

In addition to the core University fonts, there are currently alternative complementary display fonts that are suggested/recommended as part of the University [theme packs](https://communications.admin.ox.ac.uk/communications-resources/visual-identity/identity-guidelines/theme-packs). These fonts include *Marcellus*, *Montserrat*, *Bebas Neue*, and *Phudu*. Display fonts are meant to be used sparingly alongside *Roboto* and *Noto Serif*. They are also installed on managed staff desktop (CONNECT and Orchard) machines. They are also [Google Fonts](https://fonts.google.com/) hence freely available to download from the [Google Fonts website](https://fonts.google.com/).

## Checking availability of core fonts and complementary display fonts

The `oxthema` package has the `check_oxford_fonts()` function which checks the availability of the core and complementary display fonts in your machine as follows:

```{r font-check, echo = TRUE, eval = FALSE}
check_oxford_fonts()
```

and returns a message on which of the fonts are available and not available. An example output is shown below:

```{r font-check-show, echo = FALSE, eval = TRUE}
check_oxford_fonts()
```

If the font check functions indicates that some or all of the Oxford fonts are not available, we recommend taking note of the missing fonts and then downloading and installing them from the [Google Fonts website](https://fonts.google.com/).

Guidance on downloading, installing, and managing fonts, including Google Fonts, can be found [here](https://fonts.google.com/knowledge/using_type/installing_and_managing_fonts).

## Usage of Oxford fonts in the `oxthema` package

In the `oxthema` package, we use by default *Roboto* and *Noto Serif* accordingly in the various base themes.

In addition to the base themes, we have developed theme variations based on the University [theme packs](https://communications.admin.ox.ac.uk/communications-resources/visual-identity/identity-guidelines/theme-packs) that use the associated complementary display fonts in addition to *Roboto* and *Noto Serif* core fonts.

**Theme name** | **Complementary display font**
:--- | :---
Heritage | Marcellus
Contemporary | Montserrat
Celebratory | Noto Serif Display
Corporate | Bebas Neue
Innovative | Phudu

## Ensuring that Oxford fonts show appropriately

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "Oxford Theme"
title: "Oxford ggplot2 Themes"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Oxford Theme}
%\VignetteIndexEntry{Oxford ggplot2 Themes}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand All @@ -24,7 +24,7 @@ library(sysfonts)
font_add_google("Roboto")
```

The `oxthema` package has a generic/base `ggplot2` theme which is the template from which all other themes in the `oxthema` package is built on. This theme is inspired by Bob Rudis' [hrbrthemes](https://github.com/hrbrmstr/hrbrthemes) package drawing heavily on its typography-centric focus. This function uses the *Roboto* Google font which is the core Oxford san serif font. It is freely downloadable and easily installed on any system.
The `oxthema` package has a generic/base `ggplot2` theme which is the template from which all other themes in the `oxthema` package is/will be built on. This theme is inspired by Bob Rudis' [hrbrthemes](https://github.com/hrbrmstr/hrbrthemes) package drawing heavily on its typography-centric focus. This function uses the *Roboto* Google font which is the core Oxford san serif font. It is freely downloadable and easily installed on any system.

## Oxford theme palettes for use in plotting

Expand Down
16 changes: 13 additions & 3 deletions vignettes/oxthema.Rmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "University of Oxford Palette, Theme and Theme Components"
title: "University of Oxford Colours, Palettes, Fonts, and Themes"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{University of Oxford Palette, Theme and Theme Components}
%\VignetteIndexEntry{University of Oxford Colours, Palettes, Fonts, and Themes}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand All @@ -20,5 +20,15 @@ library(oxthema)

Visual identity guidelines serve as a blueprint for maintaining consistency in how an organisation presents itself visually. They emphasise the importance of correctly utilising visual elements to represent the organisation's identity and values. By adhering to these guidelines, uniformity is achieved across all communications, which contributes to fostering a consistent and positive image for the organisation. This unified visual presentation aids in conveying and promoting the organisation's academic excellence and cultural significance effectively. The University of Oxford visual identity guidelines creates such a framework through a set of colours, palettes, fonts, and themes for use in various forms of communication materials and media.

`oxthema` provides utilities for applying the University of Oxford's visual identity and/or branding guidelines. Currently, `oxthema` has colours, palettes, and `ggplot2` themes that accounts for these guidelines.
`oxthema` provides utilities for applying the University of Oxford's visual identity and/or branding guidelines. Currently, `oxthema` has colours, palettes, fonts, and themes that is consistent with these guidelines.

* [Oxford colours](https://oxford-ihtm.io/oxthema/articles/oxford-colours.html)

* [Oxford palettes](https://oxford-ihtm.io/oxthema/articles/oxford-palettes.html)

* [Oxford fonts](https://oxford-ihtm.io/oxthema/articles/oxford-fonts.html)

* [Oxford ggplot2 themes](https://oxford-ihtm.io/oxthema/articles/oxford-ggplot2-theme.html)

* [Oxford forestploter themes](https://oxford-ihtm.io/oxthema/articles/oxford-forestploter-themes.html)

0 comments on commit 81ee556

Please sign in to comment.