carpentries / varnish

Template for pkgdown site
https://carpentries.github.io/varnish/
Other
7 stars 33 forks source link

Updating fonts to support lessons in Ukrainian #133

Closed olexandr-konovalov closed 4 weeks ago

olexandr-konovalov commented 7 months ago

Following the hints in #120, I have:

I haven't tested it, since I lack knowledge about building local version of the Carpentries lesson using custom version of varnish. I would be grateful if someone can test it (maybe build the lesson at https://github.com/ukrainian-carpentries/git-novice and post a screenshot of some page here) or point me to the instructions for building it myself.

Closes #120

ErinBecker commented 3 months ago

Sorry for the delay in getting this tested @olexandr-konovalov. It took me a bit of learning to figure out how to render lessons using dovetail (although @joelnitta's guide here made things much clearer!).

I did get the ukranian-carpentries/git-novice lesson rendered locally with both the current version of varnish and the version included in this PR, however, I'm not seeing any difference in the rendered fonts (see screenshot below, official varnish on top, this PR on bottom):

Screenshot 2024-08-23 at 10 09 09 AM

It seems like the fonts you've loaded aren't being found?

For reference, the way to test with a custom version of varnish is to run the following in your R session:

install.packages(devtools)
library(devtools)
devtools::install_github("carpentries/varnish#133") 

library(dovetail)
render_trans_from_branch(lang = "uk")

Pinging @froggleston here in case he knows more about where/how new fonts are integrated and if there's a setting I'm missing here.

olexandr-konovalov commented 3 months ago

Many thanks for testing this, @ErinBecker! Indeed, it does not change the fonts. Will be waiting to hear from @froggleston

froggleston commented 1 month ago

Does this look better @olexandr-konovalov ? image

If so, the issue is that styles.css.scss needs to be modified to refer to the new fonts, referring to Mulish-Regular instead of mulish-v5-latin-regular:

/* mulish-regular */
@font-face {
  font-family: 'Mulish';
  font-style: normal;
  font-weight: 400;
  src: font('Mulish-Regular.eot'); /* IE9 Compat Modes */
  src: local(''),
       font('Mulish-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       font('Mulish-Regular.woff2') format('woff2'), /* Super Modern Browsers */
       font('Mulish-Regular.woff') format('woff'), /* Modern Browsers */
       font('Mulish-Regular.ttf') format('truetype'), /* Safari, Android, iOS */
       font('Mulish-Regular.svg#Mulish') format('svg'); /* Legacy iOS */

}

To test locally, the stylesheets can be rebuilt with bash squash-sass.sh as per the varnish docs and the lesson re-built and re-rendered using the code Erin posted above.

olexandr-konovalov commented 1 month ago

@froggleston hooray, yes, thanks, this seems to be exactly what's needed! I can try to test it locally, if you think it will be useful, but otherwise I think we can go ahead with the change.

froggleston commented 1 month ago

Thanks for the feedback @olexandr-konovalov ! I'll push a commit to address it!

In the meantime, could you merge in varnish main to this PR and we should then be in a good spot to merge it all in.

olexandr-konovalov commented 1 month ago

@froggleston thanks - do you mean I can rebase my branch on top of the latest main perhaps?

olexandr-konovalov commented 1 month ago

@froggleston rebased - please check.