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

Add instructions for custom fonts to readme #1

Closed
nucleic-acid opened this issue May 31, 2023 · 5 comments
Closed

Add instructions for custom fonts to readme #1

nucleic-acid opened this issue May 31, 2023 · 5 comments
Labels
question Further information is requested

Comments

@nucleic-acid
Copy link
Contributor

Hi, thanks for providing this extension/template. I never managed to implement this on my own and just recently found your extension.

I figured out, how to use custom fonts in the letter (I personally don't like lmodern too much).
Can I open a PR to add the details to your readme?

The font files need to be in the root folder of the *.qmd file.
Supposing the font files are called e.g. "roboto-latin-regular.ttf" or "roboto-latin-italic.ttf", etc.,
the necessary YAML options are:

mainfont: roboto
mainfontoptions:
- Extension=.ttf
- UprightFont=*-latin-regular
- BoldFont=*-latin-700
- ItalicFont=*-latin-italic
- BoldItalicFont=*-latin-700italic

This changes the font for the body, header, the address..., basically all except the back-address-field.
To change the latter, you need to also add the following:

sansfont: roboto
sansfontoptions:
- Extension=.ttf
- UprightFont=*-latin-regular
- BoldFont=*-latin-700
- ItalicFont=*-latin-italic
- BoldItalicFont=*-latin-700italic
@mavam
Copy link
Owner

mavam commented Jun 1, 2023

Thanks for reaching out! I had something like this on my todo list, but never got to it. A PR would be very much welcome! 🙏

I wonder whether we should move the fonts and other assets into a separate directory. Having one "theme" that hides the details would be the ultimate UX, but that would another layer of indirection.

@mavam mavam added the question Further information is requested label Jun 1, 2023
@nucleic-acid
Copy link
Contributor Author

Moving the fonts would be the cleaner option, but I couldn't get it to work. So I'll open a PR soon and maybe we can work out a better solution at a later point?

nucleic-acid added a commit to nucleic-acid/quarto-brief that referenced this issue Jun 2, 2023
Adds instructions to use a custom font for a letter, as discussed in mavam#1.
@mavam
Copy link
Owner

mavam commented Jun 3, 2023

Yeah, instructions on how to get started on fonts are still a good start. Thanks again for the contribution!

@mavam mavam closed this as completed Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants
@mavam @nucleic-acid and others