<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Google Fonts &#8211; Learn Beginner</title>
	<atom:link href="https://learnbeginner.com/tag/google-fonts/feed/" rel="self" type="application/rss+xml" />
	<link>https://learnbeginner.com</link>
	<description>Start Your Tech Journey With Us &#124; Smart Learning, Great Beginning</description>
	<lastBuildDate>Tue, 06 Oct 2020 13:25:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>

<image>
	<url>https://learnbeginner.com/wp-content/uploads/2021/02/favicon.png</url>
	<title>Google Fonts &#8211; Learn Beginner</title>
	<link>https://learnbeginner.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>CSS Font-display and how to use it</title>
		<link>https://learnbeginner.com/css-font-display-and-how-to-use-it/</link>
					<comments>https://learnbeginner.com/css-font-display-and-how-to-use-it/#respond</comments>
		
		<dc:creator><![CDATA[Hiren Vaghasiya]]></dc:creator>
		<pubDate>Fri, 08 May 2020 03:05:33 +0000</pubDate>
				<category><![CDATA[Beginners Guide]]></category>
		<category><![CDATA[Dev Tips]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Fonts]]></category>
		<category><![CDATA[Web Development]]></category>
		<guid isPermaLink="false">https://learnbeginner.com/?p=2626</guid>

					<description><![CDATA[As we saw yesterday, custom fonts tend to load slowly and block the browser from defining when your website is ready. This, in turn, makes Google think your website is slow, and nobody wants that.]]></description>
										<content:encoded><![CDATA[
<p>Yesterday we included a&nbsp;<a rel="noreferrer noopener" href="https://learnbeginner.com/how-to-use-google-fonts-in-your-next-web-design-project/" target="_blank">custom Google Font</a>&nbsp;on our website and briefly mentioned the&nbsp;<code><strong>font-display</strong></code>&nbsp;option. Let&#8217;s dive deeper into what it is and how it works.</p>



<p>In modern browsers, we can use the&nbsp;<code><strong>font-display</strong></code>&nbsp;function.</p>



<h4 class="wp-block-heading">Font Display options</h4>



<ul class="wp-block-list"><li><code><strong>auto</strong></code>: This is the default value, and leaves the decision up to the browser, in most cases, it will be&nbsp;<code><strong>block</strong></code></li><li><code><strong>block</strong></code>: This tells the browser to hide the text until the font has fully loaded. This is the flash you see when it swaps on some sites.</li><li><code><strong>swap</strong></code>: Swap, as the name suggests, will start with the fallback font and swap once the font is loaded.</li><li><code><strong>fallback</strong></code>: This is a compromise between&nbsp;<code><strong>auto</strong></code>&nbsp;and&nbsp;<code><strong>swap</strong></code>. It will start by hiding the font for a brief period and then go into the&nbsp;<code><strong>swap</strong></code>&nbsp;routine.</li><li><code><strong>optional</strong></code>: This is much like the&nbsp;<code><strong>fallback</strong></code>&nbsp;method. It tells the browser to start with a hide and then transition into the fallback font. The nice option here is that it allows the browser to see if the custom font is even used at all. If, for instance, a slow connection appears, they are less likely even to see the custom font.</li></ul>



<h4 class="wp-block-heading">How to use font-display</h4>



<p>As seen in the previous example, we can use it as such:</p>



<pre class="wp-block-code"><code lang="css" class="language-css">h1 {
  font-size: 40px;
  font-family: 'Amatic SC', cursive;
  font-display: swap;
}</code></pre>



<h4 class="wp-block-heading">What is a fallback font?</h4>



<p>So we talked about fallback fonts quite a bit, but what are those even?</p>



<pre class="wp-block-code"><code lang="css" class="language-css">h1 {
  font-family: 'Amatic SC', 'Times New Roman', Times, serif;
}</code></pre>



<p>So in the above example, the custom font is&nbsp;<code><strong>Amatic SC</strong></code>&nbsp;the system font is&nbsp;<code><strong>Times New Roman</strong></code>&nbsp;or&nbsp;<code><strong>Times</strong></code>, so in the case of using&nbsp;<code><strong>swap</strong></code>, we will first see&nbsp;<code><strong>Times New Roman</strong></code>&nbsp;and when the custom font has loaded it will show&nbsp;<code><strong>Amatic SC</strong></code>.</p>



<h4 class="wp-block-heading">Browser Support</h4>



<p>Not all browsers support this, but I encourage you to use&nbsp;<code><strong>font-display</strong></code>. The browsers that don&#8217;t support it will decide for you.</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="800" height="410" src="https://learnbeginner.com/wp-content/uploads/2020/05/0019-Browser-Support-Learn-Beginner.png" alt="" class="wp-image-2628" srcset="https://learnbeginner.com/wp-content/uploads/2020/05/0019-Browser-Support-Learn-Beginner.png 800w, https://learnbeginner.com/wp-content/uploads/2020/05/0019-Browser-Support-Learn-Beginner-300x154.png 300w, https://learnbeginner.com/wp-content/uploads/2020/05/0019-Browser-Support-Learn-Beginner-150x77.png 150w, https://learnbeginner.com/wp-content/uploads/2020/05/0019-Browser-Support-Learn-Beginner-768x394.png 768w, https://learnbeginner.com/wp-content/uploads/2020/05/0019-Browser-Support-Learn-Beginner-370x190.png 370w, https://learnbeginner.com/wp-content/uploads/2020/05/0019-Browser-Support-Learn-Beginner-270x138.png 270w, https://learnbeginner.com/wp-content/uploads/2020/05/0019-Browser-Support-Learn-Beginner-585x300.png 585w, https://learnbeginner.com/wp-content/uploads/2020/05/0019-Browser-Support-Learn-Beginner-570x292.png 570w, https://learnbeginner.com/wp-content/uploads/2020/05/0019-Browser-Support-Learn-Beginner-740x379.png 740w" sizes="(max-width: 800px) 100vw, 800px" /></figure>



<h4 class="wp-block-heading">Thank you for reading, and let’s connect!</h4>



<p>Thank you for reading my blog, feel free to subscribe to my email newsletter, and ask questions and give your valuable suggestions.</p>


<script>(function() {
	window.mc4wp = window.mc4wp || {
		listeners: [],
		forms: {
			on: function(evt, cb) {
				window.mc4wp.listeners.push(
					{
						event   : evt,
						callback: cb
					}
				);
			}
		}
	}
})();
</script><!-- Mailchimp for WordPress v4.10.2 - https://wordpress.org/plugins/mailchimp-for-wp/ --><form id="mc4wp-form-1" class="mc4wp-form mc4wp-form-2830 mc4wp-form-theme mc4wp-form-theme-dark" method="post" data-id="2830" data-name="Main Newsletter" ><div class="mc4wp-form-fields"><p>
	<label> 
		<input type="email" name="EMAIL" placeholder="Your email address"  style="max-width: 100%;" required />
	</label>
	<input type="submit" value="Subscribe Now" style="width: 100%;" />
</p></div><label style="display: none !important;">Leave this field empty if you&#8217;re human: <input type="text" name="_mc4wp_honeypot" value="" tabindex="-1" autocomplete="off" /></label><input type="hidden" name="_mc4wp_timestamp" value="1742447678" /><input type="hidden" name="_mc4wp_form_id" value="2830" /><input type="hidden" name="_mc4wp_form_element_id" value="mc4wp-form-1" /><div class="mc4wp-response"></div></form><!-- / Mailchimp for WordPress Plugin -->]]></content:encoded>
					
					<wfw:commentRss>https://learnbeginner.com/css-font-display-and-how-to-use-it/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to use Google Fonts in your next web design project</title>
		<link>https://learnbeginner.com/how-to-use-google-fonts-in-your-next-web-design-project/</link>
					<comments>https://learnbeginner.com/how-to-use-google-fonts-in-your-next-web-design-project/#comments</comments>
		
		<dc:creator><![CDATA[Hiren Vaghasiya]]></dc:creator>
		<pubDate>Thu, 07 May 2020 14:39:41 +0000</pubDate>
				<category><![CDATA[Beginners Guide]]></category>
		<category><![CDATA[Dev Tips]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Fonts]]></category>
		<category><![CDATA[Web Development]]></category>
		<guid isPermaLink="false">https://learnbeginner.com/?p=2622</guid>

					<description><![CDATA[Google fonts are an awesome way of adding a cool font to your website, I use them in client websites all the time, and they are amazing and simple to use.]]></description>
										<content:encoded><![CDATA[
<p>Let&#8217;s get started on implementing a custom font for your website.</p>



<h4 class="wp-block-heading">Finding your Google Font</h4>



<p>To find a cool font, we can go to the&nbsp;<a rel="noreferrer noopener" href="https://fonts.google.com/" target="_blank">Google Font library</a>&nbsp;and pick one we like.</p>



<p>Once you have found the one you want, open it up you will see the whole set&#8217;s letters and Styles. Google Fonts will allow you to include on our more styles on your website. In my case, I&#8217;m using&nbsp;<a rel="noreferrer noopener" href="https://fonts.google.com/specimen/Amatic+SC?sidebar.open&amp;selection.family=Amatic+SC" target="_blank">Amatic SC Bold</a>. Click the&nbsp;<code><strong>Select this style</strong></code>&nbsp;button for each style you want. You will see a side menu on the right. It will have a&nbsp;<code><strong>Review</strong></code>&nbsp;and&nbsp;<code><strong>Embed</strong></code>&nbsp;section; in the embed, we can get the code.</p>



<h4 class="wp-block-heading">Embedding the Google Font in your website</h4>



<p>There are two ways of embedding the font into your website</p>



<ul class="wp-block-list"><li><code><strong>&lt;link&gt;</strong></code>&nbsp;attribute; this sets a link like any external stylesheet</li><li><code><strong>@import</strong></code>&nbsp;this imports it directly in the&nbsp;<code><strong>CSS</strong></code></li></ul>



<p>The Google Fonts website will also show you which&nbsp;<code><strong>font-family</strong></code>&nbsp;rule you must apply to each element you want to have this specific font.</p>



<h4 class="wp-block-heading">Should I use Link or @import?</h4>



<p>This is a question that keeps floating around on the internet, and&nbsp;<a rel="noreferrer noopener" href="http://www.stevesouders.com/blog/2009/04/09/dont-use-import/" target="_blank">Steve Souders</a>&nbsp;did an excellent job of comparing the two. As his article title suggests,is the best way to go according to him and&nbsp;<a rel="noreferrer noopener" href="https://developer.yahoo.com/performance/rules.html#csslink" target="_blank">Yahoo</a>.</p>



<h4 class="wp-block-heading">Using the Google Font on our website</h4>



<pre class="wp-block-code"><code lang="markup" class="language-markup">&lt;head>
  &lt;link
    href="https://fonts.googleapis.com/css2?family=Amatic+SC:wght@700&amp;display=swap"
    rel="stylesheet"
  />
&lt;/head></code></pre>



<p>We embed the Google Font in the head of our&nbsp;<code><strong>HTML</strong></code>&nbsp;file using the following code. This is the code you get from Google Fonts.</p>



<p>Then in our&nbsp;<code><strong>CSS</strong></code>&nbsp;we can do the following:</p>



<pre class="wp-block-code"><code lang="css" class="language-css">h1 {
  font-family: 'Amatic SC', cursive;
}</code></pre>



<p>It&#8217;s important to use the name as stated in Google Fonts website.</p>



<h4 class="wp-block-heading">What to think about</h4>



<p>So important to note when using Google Fonts, they tend to load slowly, the more you use, the more load time it will add. And Google itself will not like that very much. My suggestion is that you keep it to one custom font. We can use&nbsp;<code><strong>font-display: swap</strong></code>&nbsp;to not interfere with the load, more on this in another article!</p>



<h4 class="wp-block-heading">Thank you for reading, and let&#8217;s connect!</h4>



<p>Thank you for reading my blog, feel free to subscribe to my email newsletter, and ask questions and give your valuable suggestions.</p>


<script>(function() {
	window.mc4wp = window.mc4wp || {
		listeners: [],
		forms: {
			on: function(evt, cb) {
				window.mc4wp.listeners.push(
					{
						event   : evt,
						callback: cb
					}
				);
			}
		}
	}
})();
</script><!-- Mailchimp for WordPress v4.10.2 - https://wordpress.org/plugins/mailchimp-for-wp/ --><form id="mc4wp-form-2" class="mc4wp-form mc4wp-form-2830 mc4wp-form-theme mc4wp-form-theme-dark" method="post" data-id="2830" data-name="Main Newsletter" ><div class="mc4wp-form-fields"><p>
	<label> 
		<input type="email" name="EMAIL" placeholder="Your email address"  style="max-width: 100%;" required />
	</label>
	<input type="submit" value="Subscribe Now" style="width: 100%;" />
</p></div><label style="display: none !important;">Leave this field empty if you&#8217;re human: <input type="text" name="_mc4wp_honeypot" value="" tabindex="-1" autocomplete="off" /></label><input type="hidden" name="_mc4wp_timestamp" value="1742447678" /><input type="hidden" name="_mc4wp_form_id" value="2830" /><input type="hidden" name="_mc4wp_form_element_id" value="mc4wp-form-2" /><div class="mc4wp-response"></div></form><!-- / Mailchimp for WordPress Plugin -->]]></content:encoded>
					
					<wfw:commentRss>https://learnbeginner.com/how-to-use-google-fonts-in-your-next-web-design-project/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
