Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemfonts and friends #128

Merged
merged 86 commits into from
May 4, 2021
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
ee90666
set up env and font registry
matthewstern Apr 3, 2021
972f828
tweak
matthewstern Apr 3, 2021
12e15cb
revert back to `globals`
matthewstern Apr 3, 2021
7060aa5
implement envir getter and setter
matthewstern Apr 3, 2021
874bff3
documentation
matthewstern Apr 3, 2021
0f7bb58
left some notes
matthewstern Apr 3, 2021
1de5255
more fiddling
matthewstern Apr 3, 2021
02c1021
working now, check passes
matthewstern Apr 3, 2021
21d0bec
working get and set
matthewstern Apr 3, 2021
af920ef
mas
matthewstern Apr 3, 2021
b906067
documentation
matthewstern Apr 3, 2021
680c7ca
final changes? I hope
matthewstern Apr 5, 2021
9ca3cd9
set global tweak
matthewstern Apr 5, 2021
44fa37b
Update DESCRIPTION
matthewstern Apr 5, 2021
d8d99d7
Move helper functions into utilities.R
nmpeterson Apr 5, 2021
9169794
Minor edits
nmpeterson Apr 5, 2021
f87e295
Moved geoms_that_change definition into cmapplot_globals.R
nmpeterson Apr 5, 2021
6289616
Fixed typo
nmpeterson Apr 5, 2021
eed0806
Added note about font size units
nmpeterson Apr 5, 2021
3f345bf
Rebuilt documentation
nmpeterson Apr 5, 2021
cc4ca16
Merge branch 'version1.2' into systemfonts
matthewstern Apr 5, 2021
c4dcaa1
Corrected font size note
nmpeterson Apr 5, 2021
b721dee
Merge branch 'systemfonts' of https://github.com/CMAP-REPOS/cmapplot …
nmpeterson Apr 5, 2021
44fbb83
Create test pkgdown action
nmpeterson Apr 5, 2021
1b200fc
Rebuilt NAMESPACE
nmpeterson Apr 5, 2021
9db07e9
Reference list tweaks
nmpeterson Apr 5, 2021
11db673
Print all located font files in log
nmpeterson Apr 5, 2021
4da37df
Don't force all non-numeric types to character
nmpeterson Apr 5, 2021
cc40816
Attempt to register fonts
nmpeterson Apr 5, 2021
c3d3aa6
Corrected syntax issue
nmpeterson Apr 5, 2021
715fd28
Corrected another syntax issue
nmpeterson Apr 5, 2021
5a46945
Unload/reload cmapplot before deploy
nmpeterson Apr 5, 2021
130c5b2
Try devtools::reload() instead
nmpeterson Apr 5, 2021
fdcf783
One last attempt for the day...
nmpeterson Apr 5, 2021
32cb822
Just kidding, this is the real last attempt today
nmpeterson Apr 5, 2021
9ec7364
Check for Whitney in systemfonts::registry_fonts() too
nmpeterson Apr 6, 2021
2cfec6f
Manually register fonts
nmpeterson Apr 6, 2021
608be33
Print registry_fonts() family/path to log
nmpeterson Apr 6, 2021
c022a2b
a test
matthewstern Apr 6, 2021
11dc0ff
test 2
matthewstern Apr 6, 2021
f69c275
typo
matthewstern Apr 7, 2021
881a496
no italics?
matthewstern Apr 7, 2021
ac2932d
Register fonts from cloned repo instead of ~/Library/Fonts
nmpeterson Apr 7, 2021
f4e8d1b
print font registry in vignette
matthewstern Apr 10, 2021
418944f
print contents of VM font folder
matthewstern Apr 11, 2021
4b9e647
clean up pkgdown GHA
matthewstern Apr 11, 2021
da5ab92
typo
matthewstern Apr 11, 2021
3b08605
tweak font dir
matthewstern Apr 11, 2021
524f73a
another typo
matthewstern Apr 11, 2021
a8ba100
mac font registration attempt 1
matthewstern Apr 11, 2021
ad921ba
typo
matthewstern Apr 11, 2021
a20eb26
new branch
matthewstern Apr 12, 2021
1b519ac
test
matthewstern Apr 16, 2021
013787b
typo
matthewstern Apr 16, 2021
51b8f24
getting things working again
matthewstern Apr 19, 2021
b62472b
clean up vignette testing
matthewstern Apr 19, 2021
6c3e4ac
update pkgdown GHAs
matthewstern Apr 19, 2021
8274a64
Merge branch 'version1.2' into systemfonts
matthewstern Apr 19, 2021
90803ab
adjust location of preferred font names
matthewstern Apr 19, 2021
5ff89ba
Minor tweaks
nmpeterson Apr 21, 2021
bc4adb2
custom registration
matthewstern Apr 23, 2021
233773a
test message
matthewstern Apr 23, 2021
5ba8cde
new check
matthewstern Apr 23, 2021
cface8d
new check
matthewstern Apr 23, 2021
c76adff
new check
matthewstern Apr 23, 2021
ba44649
more checkssss
matthewstern Apr 23, 2021
5546ff2
new checks
matthewstern Apr 23, 2021
ba1590a
I think I found it!
matthewstern Apr 23, 2021
64e2ce8
lets try this
matthewstern Apr 23, 2021
0fe7e7f
famous last words
matthewstern Apr 23, 2021
c698e0f
whoops
matthewstern Apr 23, 2021
c56726b
check() works
matthewstern Apr 25, 2021
50a921d
require agg for rstudio graphics
matthewstern Apr 25, 2021
9daa57c
typo in grep
matthewstern Apr 25, 2021
53c8627
documentation updates
matthewstern Apr 25, 2021
8ce6f93
clearer messages
matthewstern Apr 25, 2021
6e6ea4e
simplify `try()` and clarify comments
matthewstern May 1, 2021
661667a
typo
matthewstern May 1, 2021
840b1d5
small tweaks
matthewstern May 2, 2021
c2c7b49
attempt at dynamic GHA workflow
May 2, 2021
e74c216
tweaks to GHA
May 2, 2021
8204056
Remove pkgtown test workflow, update main workflow
May 2, 2021
699f2da
Modified text formatting example
nmpeterson May 3, 2021
a1caf11
Modified text formatting example
nmpeterson May 3, 2021
612c01e
Handle edge case
dlcomeaux May 4, 2021
51d467e
add path length requirement
matthewstern May 4, 2021
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
29 changes: 23 additions & 6 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Automatically rebuilds pkgdown website any time master branch is updated.
# Also builds pkgdown on "gh-pages-test" on commits to pull requests.
# Based on <https://github.com/r-lib/actions/blob/master/examples/pkgdown.yaml>.
# Conditional based on <https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables>.
on:
push:
branches: master
pull_request:

name: pkgdown

Expand Down Expand Up @@ -56,18 +59,32 @@ jobs:
install.packages("pkgdown")
shell: Rscript {0}

- name: Check Whitney availability
- name: Check Whitney availability in R
run: |
message(paste(sysfonts::font_paths(), collapse = "\n"))
all_fonts <- sysfonts::font_files()
message(paste(all_fonts[all_fonts$family %in% c("Whitney Medium", "Whitney Book", "Whitney Semibold") & all_fonts$face=="Regular", "file"], collapse = "\n"))
all_fonts <- systemfonts::system_fonts()
message("WHITNEY FONTS AUTOMATICALLY AVAILABLE TO SYSTEMFONTS:")
message(paste(all_fonts$name[grepl("^Whitney", all_fonts$name)], collapse = "\n"))
user_dir <- paste0(Sys.getenv("HOME"), "/Library/Fonts")
library_fonts <- list.files(user_dir)
message(paste0("WHITNEY FONTS IN ", user_dir, " (MUST BE REGISTERED):"))
message(paste(library_fonts[grepl("^Whitney", library_fonts)], collapse = "\n"))
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Deploy package
- name: Deploy package to live branch
if: ${{ github.ref == 'refs/heads/main' }}
run: |
echo "This is $GITHUB_REF. Deploying to gh-pages branch."
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, clean = TRUE)'
Rscript -e 'pkgdown::deploy_to_branch(clean = TRUE)'

- name: Deploy package to test branch
if: ${{ github.ref != 'refs/heads/main' }}
run: |
echo "This is $GITHUB_REF. Deploying to gh-pages-test branch."
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(branch="gh-pages-test", clean = TRUE)'
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ Imports:
lubridate,
magrittr,
purrr,
ragg,
rlang,
rstudioapi,
scales,
stringr,
sysfonts
systemfonts
Suggests:
knitr,
rmarkdown,
Expand Down
7 changes: 5 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ export(cmap_fill_highlight)
export(cmap_fill_race)
export(cmap_gradients)
export(cmap_palettes)
export(cmapplot_globals)
export(finalize_plot)
export(geom_recessions)
export(geom_text_lastonly)
export(get_cmapplot_global)
export(get_cmapplot_globals)
export(gg_lwd_convert)
export(set_cmapplot_global)
export(theme_cmap)
export(unapply_cmap_default_aes)
export(update_recessions)
Expand All @@ -38,7 +40,9 @@ import(graphics)
import(grid)
import(gridtext)
import(rlang)
import(rstudioapi)
import(scales)
import(systemfonts)
importFrom(generics,intersect)
importFrom(ggpubr,get_legend)
importFrom(glue,glue)
Expand All @@ -55,6 +59,5 @@ importFrom(stats,na.omit)
importFrom(stringr,str_length)
importFrom(stringr,str_replace)
importFrom(stringr,str_trunc)
importFrom(sysfonts,font_files)
importFrom(utils,modifyList)
importFrom(utils,read.csv)
Loading