diff --git a/DESCRIPTION b/DESCRIPTION index 58f4e7f..ddb5f66 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,9 +1,12 @@ Package: noradplot Type: Package Title: Norad colour palette and theme for ggplot2 graphics -Version: 0.1.0 -Author: Norad -Maintainer: Einar Tornes +Version: 0.3.0 +Authors@R: c( + person("Einar", "Tornes", email = "einar.tornes@norad.no", role = c("aut", "cre")), + person("Eivind", "Hammersmark", "Moe", email = "eivind.moe.hammersmark@norad.no", role = "aut"), + person("Norad", role = c("cph", "fnd")) + ) Description: Provides Norads colour palette and theme for creating ggplot2 graphics. Credits: Based on Simon Jackson's blog post: Creating corporate colour palettes for ggplot2, BBC BBC Visual and Data Journalism cookbook for R graphics: https://bbc.github.io/rcookbook/ and Meghan Halls blog post Creating Custom colour palettes for ggplot2: https://meghan.rbind.io/blog/2022-10-11-creating-custom-color-palettes-with-ggplot2/. License: MIT + file LICENSE Encoding: UTF-8 diff --git a/R/ggnorad.R b/R/ggnorad.R index b2b95b3..a53e104 100644 --- a/R/ggnorad.R +++ b/R/ggnorad.R @@ -8,16 +8,19 @@ ggnorad <- function(...) { showtext::showtext_auto() + fonts_dir <- system.file("fonts", package = "noradplot") sysfonts::font_add(family = "Norad Sans", - regular = "https://github.com/noradno/noradplot/raw/main/fonts/NoradSans-Regular.otf", - bold = "https://github.com/noradno/noradplot/raw/main/fonts/NoradSans-Bold.otf", - italic = "https://github.com/noradno/noradplot/raw/main/fonts/NoradSans-Italic.otf", - bolditalic = "https://github.com/noradno/noradplot/raw/main/fonts/NoradSans-BoldItalic.otf") + regular = paste0(fonts_dir, "/NoradSans-Regular.otf"), + bold = paste0(fonts_dir, "/NoradSans-Bold.otf"), + italic = paste0(fonts_dir, "/NoradSans-Italic.otf"), + bolditalic = paste0(fonts_dir, "/NoradSans-BoldItalic.otf")) + sysfonts::font_add(family = "Norad Serif", - regular = "https://github.com/noradno/noradplot/raw/main/fonts/NoradSerif-Regular.otf", - bold = "https://github.com/noradno/noradplot/raw/main/fonts/NoradSerif-Bold.otf", - italic = "https://github.com/noradno/noradplot/raw/main/fonts/NoradSerif-Italic.otf", - bolditalic = "https://github.com/noradno/noradplot/raw/main/fonts/NoradSerif-BoldItalic.otf") + regular = paste0(fonts_dir, "/NoradSerif-Regular.otf"), + bold = paste0(fonts_dir, "/NoradSerif-Bold.otf"), + italic = paste0(fonts_dir, "/NoradSerif-Italic.otf"), + bolditalic = paste0(fonts_dir, "/NoradSerif-BoldItalic.otf")) + ggplot2::update_geom_defaults("path", list(linewidth = 1)) ggplot2::theme_set(theme_norad()) diff --git a/fonts/NoradSans-Bold.otf b/inst/fonts/NoradSans-Bold.otf similarity index 100% rename from fonts/NoradSans-Bold.otf rename to inst/fonts/NoradSans-Bold.otf diff --git a/fonts/NoradSans-BoldItalic.otf b/inst/fonts/NoradSans-BoldItalic.otf similarity index 100% rename from fonts/NoradSans-BoldItalic.otf rename to inst/fonts/NoradSans-BoldItalic.otf diff --git a/fonts/NoradSans-Italic.otf b/inst/fonts/NoradSans-Italic.otf similarity index 100% rename from fonts/NoradSans-Italic.otf rename to inst/fonts/NoradSans-Italic.otf diff --git a/fonts/NoradSans-Medium.otf b/inst/fonts/NoradSans-Medium.otf similarity index 100% rename from fonts/NoradSans-Medium.otf rename to inst/fonts/NoradSans-Medium.otf diff --git a/fonts/NoradSans-MediumItalic.otf b/inst/fonts/NoradSans-MediumItalic.otf similarity index 100% rename from fonts/NoradSans-MediumItalic.otf rename to inst/fonts/NoradSans-MediumItalic.otf diff --git a/fonts/NoradSans-Regular.otf b/inst/fonts/NoradSans-Regular.otf similarity index 100% rename from fonts/NoradSans-Regular.otf rename to inst/fonts/NoradSans-Regular.otf diff --git a/fonts/NoradSerif-Bold.otf b/inst/fonts/NoradSerif-Bold.otf similarity index 100% rename from fonts/NoradSerif-Bold.otf rename to inst/fonts/NoradSerif-Bold.otf diff --git a/fonts/NoradSerif-BoldItalic.otf b/inst/fonts/NoradSerif-BoldItalic.otf similarity index 100% rename from fonts/NoradSerif-BoldItalic.otf rename to inst/fonts/NoradSerif-BoldItalic.otf diff --git a/fonts/NoradSerif-Italic.otf b/inst/fonts/NoradSerif-Italic.otf similarity index 100% rename from fonts/NoradSerif-Italic.otf rename to inst/fonts/NoradSerif-Italic.otf diff --git a/fonts/NoradSerif-Medium.otf b/inst/fonts/NoradSerif-Medium.otf similarity index 100% rename from fonts/NoradSerif-Medium.otf rename to inst/fonts/NoradSerif-Medium.otf diff --git a/fonts/NoradSerif-MediumItalic.otf b/inst/fonts/NoradSerif-MediumItalic.otf similarity index 100% rename from fonts/NoradSerif-MediumItalic.otf rename to inst/fonts/NoradSerif-MediumItalic.otf diff --git a/fonts/NoradSerif-Regular.otf b/inst/fonts/NoradSerif-Regular.otf similarity index 100% rename from fonts/NoradSerif-Regular.otf rename to inst/fonts/NoradSerif-Regular.otf