Home > Software design >  Change the url of fonts in Bootstrap 5
Change the url of fonts in Bootstrap 5

Time:05-24

I want to change the url Bootstrap uses to search for fonts (to host them on myserver, rather than force users to ping Google every page load), however I cannot find the urls I see being hit when the page loads anywhere in the css of Bootstrap...

enter image description here

https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxK.woff2

All three seem to be iterations of the Roboto font. I can see where the font is used in the bootstrap css, but not actually defined.

CodePudding user response:

Bootstrap 5 doesn't provide download links for fonts. Instead it has a list of possible system fonts that should cascade until it hits one of your system defaults - Roboto, in this case, being an android default. Are you sure you haven't included a link to Roboto somewhere else? Check for the initiator column in your browser dev tools to see where the cvall is being made.

Here's the docs for bootstrap 5 where they discuss the 'native stack' approach: https://getbootstrap.com/docs/5.0/content/reboot/#native-font-stack

  • Related