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

Document how to use a non-Google font #2461

Merged
merged 3 commits into from
Apr 19, 2024
Merged

Document how to use a non-Google font #2461

merged 3 commits into from
Apr 19, 2024

Conversation

hadley
Copy link
Member

@hadley hadley commented Apr 17, 2024

Fixes #1968

@hadley hadley requested a review from maelle April 17, 2024 21:39
Copy link
Collaborator

@maelle maelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How I wish I could have read this before I had to use custom fonts 😺

vignettes/customise.Rmd Outdated Show resolved Hide resolved
vignettes/customise.Rmd Outdated Show resolved Hide resolved

Theming with bslib is powered by `bslib::bs_theme()` and the `bslib` field is a direct translation of the arguments to that function.
As a result, you can fully specify a bslib theme using the `template.bslib` field, making it easy to share YAML with the `output.html_document.theme` field [of an R Markdown document](https://rstudio.github.io/bslib/articles/theming/index.html).
* As a link to a style file, which you'll need to add to the `<head>` using this syntax:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* As a link to a style file, which you'll need to add to the `<head>` using this syntax:
* As a link to a style file that you might use for another website, which you'll need to add to the `<head>` using this syntax:

would this be the use case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was inspired by https://cocktails.hadley.nz, which uses typography.com, which gives you a stylesheet that you need to put in the head. Given that I only have two examples of using non-Google webfonts and they're both totally different, I don't want to get too specific in this vignette.

```

When iterating on fonts, you'll need to run `build_home_index(); init_site()` then refresh you browwser to see the update.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know these are pkgdown docs, not general font docs, but I wonder whether we could add a link about things such as https://chromewebstore.google.com/detail/cors-unblock/lfhmikememgdcahcdlaciloancbhjino Or maybe it's just a matter of linking to something about the web dev console from this vignette, as one could then see and google the error message.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a paragraph with some more general advice.

@hadley hadley requested a review from maelle April 18, 2024 19:07
vignettes/customise.Rmd Outdated Show resolved Hide resolved
Co-authored-by: Maëlle Salmon <[email protected]>
@hadley hadley merged commit cb815fd into main Apr 19, 2024
11 checks passed
@hadley hadley deleted the custom-fonts branch April 19, 2024 13:37
SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this pull request Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add docs or link to docs of how to specify a non Google font
2 participants