Python Web Apps that Fly with CDNs Transcripts
Chapter: Fonts
Lecture: Fonts are tricky on the web

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Fonts are tricky on the web. There's a whole bunch of cool fonts out there. And what you would like to say is,
0:08 "Hey, can we use the Agave Nerd font mono for our code here?" Well, maybe, but by default, you gotta say, if I go to my CSS style sheet and say,
0:21 "I wanna use the Agave Nerd font mono," and that's all, then whoever comes to that site is gonna have to have that installed on their system.
0:29 So good luck, it's installed over here on my Mac. Oh, but on my Windows machine, it doesn't look like it. So this difference, this is a huge challenge.
0:40 And like, let's not even get started on mobile platforms with a thousand different Android's and different versions of iOS and things like that.
0:49 So it's a big problem. So what do people do? Well, they say, "What if we could use some kind of hosted font?"
0:56 You saw earlier when I was diagnosing the problems in the troubleshooting section, we were having issues with the Font Awesome font,
1:03 which was being served directly out of our website. Something that's really common to do is say, let's go use something like Google Fonts.
1:10 So fonts.google.com, you can go over here and you can see there's 1,490 families of fonts. And then within each family,
1:19 there's variations like a bold and italics, a thin, a light, all the variations you might expect there.
1:26 So tons of options and all you do is you check off the ones you want and then you put some kind of link in your website. Problem solved.
1:35 Because that way when people show up, it doesn't depend on them having the fonts.
1:38 It says as part of this website, please go to fonts.googleapis.com, request this font family and then load it up and you'll be good to go.


Talk Python's Mastodon Michael Kennedy's Mastodon