-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
`cmapplot_global` env initializes with "sans" (e.g. Arial) as default font. .onLoad uses systemfonts pkg to register Whitney if available and overwrite fonts as Whitney instead. the `display_cmap_fonts()` test function is updated to call on the new `cmapplot_global` env rather than the `cmapplot_globals` list.
gave up on new cmap_global nomenclature--too many references throughout package to update. Converted remaining items from the list to the environment.
basic, for testing. would need documentation if it works.
not sure why exporting doesn't seem to be working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- On cmap laptop:
- Installed from GitHub using devtools.
- Vignettes and locally built pkgdown site looked good from a quick click-through,
- plot creation within RStudio with ragg backend looks good.
- On personal mac:
- Installed with GitHub using devtools.
- Vignettes look good, did not try local pkgdown site
- plotting in RStudio with ragg backend looks good (same as PC plot)
- I'll look into how/if the 'window' mode would work with ragg as part of finalize_plot. I'll pull these changes into my v1.2finalize branch to make sure everything works together.
Thanks @sarahcmap, Mac confirmation with systemfonts is really exciting! Any chance the Whitney fonts on your cmap laptop are installed NOT in |
They are in the usual folder (C:/Windows/Fonts), so can't comment on that item unfortunately! |
I've taken a look on my Windows laptop; still have to review on Mac. Moved a few chunks of code around. It looks like, if you don't explicitly change the default graphics rendering in RStudio to AGG, plots will produce errors like the following, which I... don't love. Does everybody else get these errors, too?
If we go forward with this, we'll have to update the readme and the installation vignette to make it very clear that AGG has to be used. |
Also, I just ran |
looks like options() isn't sticky across R sessions, which seems strange to me.
primary pkgdown workflow now deploys to gh-pages-test on any open PR update, and *should* deploy to gh-pages on push to master.
This is ready for re-review! This branch now...
FWIW, the fonts I've chosen to stand in as the various needed variants. There is some discretion with what is used for bold, I picked what made the most sense to me:
|
Works as advertised on my CMAP laptop |
EDIT: I solved this - for some reason, I have the fonts installed twice, and that was causing the code to error. I added in an automatic adjustment to use just the first font in this case. @matthewstern let me know if you think this would cause any other issues in the code, I can't think of any but you're the one who's been deep in this. I tried installing the latest version of this branch onto my CMAP laptop and was not able to get it to work. To confirm what I was supposed to do:
When I do so, I got an error during installation, specifically relating to semibold:
This is a bit confusing to me, because when I run the |
If there are multiple copies of a font installed (like is the case on my machine for whatever reason...not sure if I did that by mistake).
Thanks for the thorough testing and tweak @dlcomeaux. This shouldn't cause any new errors I can think of because the way the filename is calculated: BTW I believe the repeat errors you experienced on installation were because you had |
Speaking of which, @sarahcmap @nmpeterson @nmpeterson did any of you install .ttfs? I've only tested with .otfs and am curious to confirm that everything renders similarly with .ttfs. |
Is |
@matthewstern I have not tried TTFs. I.T. only gave me OTFs. I created the TTF files using a website that does the format conversion because at one point when I was originally working on the font specification I was considering using a package that only worked with TTFs. However, I have no idea how reliable that conversion process was -- the resulting TTFs could conceivably have issues due to their dubious origin, so probably best to stick with the OTFs. (Please feel free to test, though, either with the Whitney TTFs or another typeface for which you can obtain "official" TTFs.) |
Thanks Noel. @dlcomeaux just tested with the TTFs you shared with us some time ago and indicated they worked. I had forgotten that you had manufactured them, though! Good to know, and I will stick to OTFs going forward. TBH I'm just glad I'm finally figuring out how to speak in regex a bit. |
Changes
cmapplot_globals
from an exported list to an environmentget_cmapplot_globals
,get_cmapplot_global
, andset_cmapplot_global
to view and override entries within globals if needed. New documentation as needed.moved the package startup message from.onLoad
to.onAttach
to avoid the note produced bydevtools::check
and conform to best practices.cmapplot_globals
creation into new filecmapplot_globals.R
gh-pages-test
branch on any PR, and togh-pages
on push to master.Note that
finalize_plot
saved outputs won't work as this PR does not encapsulate the work in progress by @sarahcmap, but it should look right in the plots window if you have updated RStudio and enabled an "agg" backend.Testing requests:
check()
is producing an error at "rebuilding vignette outputs" about ragg. I believe I modified the vignettes correctly as per here and the output does seem to be working for me. Will others explore to see if they run into the same issue? (This may not be our problem?)devtools::install_github("CMAP-REPOS/cmapplot", "systemfonts", build_vignettes = TRUE)
)C:/Windows/fonts/
. I believe this will be the case if you installed Whitney without an admin password from IT.confirm here:
To dos this PR produces:
finalize_plot
. @sarahcmap if this PR gets merged in would you be willing to explore this along with your other modifications to that function?theme_cmap()
andfinalize_plot()
. If these now do not cause errors, rewrite the example sections of these documentation pages to actually run examples.