The speaker discusses the benefits and drawbacks of using Google Fonts and suggests a more efficient method to self-host fonts for better performance and user experience. They argue that using Google Fonts can harm SEO and user experience due to the extra requests and potential privacy concerns. Instead, they recommend using a service like FontSource, which provides Google Fonts as npm packages. This method allows developers to install and import fonts into their code without relying on Google's CDN. The speaker demonstrates this process using SvelteKit and Tailwind CSS, showing how to install fonts, import them into the code, and apply them in the layout. They also highlight the importance of considering SEO, user experience, and privacy when choosing a font hosting solution.
1. Google Fonts allows users to browse through thousands of font families, filter on supported languages, and preview their own copy.
2. Using Google CDN to bring in selected fonts is common practice but is not recommended due to cost implications.
3. Self-hosting fonts is a better approach as it avoids the extra cost associated with using Google CDN.
4. FontSource, a service that publishes all Google fonts and other open source fonts as npm packages, can be used for self-hosting.
5. Users can still use Google Fonts to browse and identify the fonts they want to self-host.
6. The process of installing fonts as dependencies and importing them into the code can be done using any package manager like npm, pnpm, or Bun.
7. In SvelteKit projects, fonts intended for use throughout the app can be imported in a root `+layout.svelte`.
8. The Google Way of using Google CDN for fonts can harm SEO and user experience.
9. The Google CDN method requires extra steps such as resolving the DNS, forming a connection, making it secure, and loading the font file.
10. Self-hosting fonts can improve metrics such as first contentful paint and core web vitals such as largest contentful paint and cumulative layout shift.
11. Google's use of Google CDN for fonts can also lead to user profiling, which may be a concern for privacy-conscious users.
12. Despite the potential privacy concerns, many users may dismiss this as they already use Google Analytics, which heavily profiles users.
13. There is a higher chance of messing up when self-hosting fonts compared to pasting Google links, but experts suggest that the more one watches and shares information on this topic, the lower that chance gets.