<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ fonts - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ fonts - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Mon, 25 May 2026 05:06:36 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/fonts/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Pick a Font – An In-Depth Guide for Developers ]]>
                </title>
                <description>
                    <![CDATA[ Fonts are not always free. If you're fetching a font that isn't already on your user's phone or computer, they'll have to download it. And this will impact performance. In documents and subtitles, emb ]]>
                </description>
                <link>https://www.freecodecamp.org/news/things-to-consider-when-picking-fonts/</link>
                <guid isPermaLink="false">66d460f88812486a37369d5c</guid>
                
                    <category>
                        <![CDATA[ fonts ]]>
                    </category>
                
                    <category>
                        <![CDATA[ performance ]]>
                    </category>
                
                    <category>
                        <![CDATA[ UI Design ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Seth Falco ]]>
                </dc:creator>
                <pubDate>Wed, 13 Sep 2023 11:18:31 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/uploads/covers/5e1e335a7a1d3fcc59028c64/12ee3390-c16b-4467-8437-67706712a2e5.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Fonts are not always free. If you're fetching a font that isn't already on your user's phone or computer, they'll have to download it. And this will impact performance.</p>
<p>In documents and subtitles, embedding fonts can easily increase the file size tenfold. As for the web, here are some popular fonts and a potential network impact:</p>
<table>
<thead>
<tr>
<th>Font</th>
<th>Size</th>
<th>Wi-Fi</th>
<th>Regular 4G/LTE</th>
<th>Regular 3G</th>
</tr>
</thead>
<tbody><tr>
<td><a href="https://fonts.bunny.net/family/roboto">Roboto</a></td>
<td>160 KB</td>
<td>0.04 s</td>
<td>0.34 s</td>
<td>1.81 s</td>
</tr>
<tr>
<td><a href="https://fonts.bunny.net/family/montserrat">Montserrat</a></td>
<td>217 KB</td>
<td>0.06 s</td>
<td>0.45 s</td>
<td>2.41 s</td>
</tr>
<tr>
<td><a href="https://fonts.bunny.net/family/inter">Inter</a></td>
<td>253 KB</td>
<td>0.07 s</td>
<td>0.53 s</td>
<td>2.80 s</td>
</tr>
<tr>
<td><a href="https://fonts.bunny.net/family/noto-sans">Noto Sans</a></td>
<td>292 KB</td>
<td>0.08 s</td>
<td>0.60 s</td>
<td>3.21 s</td>
</tr>
<tr>
<td><a href="https://fonts.bunny.net/family/jetbrains-mono">JetBrains Mono</a></td>
<td>125 KB</td>
<td>0.04 s</td>
<td>0.27 s</td>
<td>1.43 s</td>
</tr>
</tbody></table>
<p><em>Size is based on rendering "Hello, Čihař!" in regular, bold, italic, and bold italic – it varies based on what characters you use. The estimated network speeds and latency are taken from</em> <a href="https://firefox-source-docs.mozilla.org/devtools-user/network_monitor/throttling/index.html"><em>Throttling - Firefox Source Docs</em></a><em>.</em></p>
<p>On the modern web, we've normalized fetching fonts from client-side, or embedding fonts in resources that are served to users. While this may be tempting, it actually makes very little sense for most use-cases.</p>
<p>This isn't suggesting to never use external fonts. Just a reminder that fonts aren't free, and that it's a good idea to review if it's worth packaging or fetching external fonts when it's avoidable.</p>
<p>Instead, I'd recommend you consider an expansive font selection, featuring typefaces available across operating systems. There are times we should fetch external fonts, but it shouldn't be the default attitude in everything that we build.</p>
<p>In short, you may just need an arbitrary typeface to show arbitrary text on your website. That's fine. But it's worth sticking to the wide array of typefaces already installed on the client's operating system.</p>
<p>In other words… only fetch an external font when it actually enhances the user experience!</p>
<h2 id="heading-why">Why?</h2>
<p>Given the number of typefaces available on all operating systems, there are likely many suitable options for your use-case.</p>
<p>There's no need to specifically fetch Roboto, Inter, or another font that's similar enough to the preinstalled options.</p>
<p>This is particularly relevant to corporate websites, blogs, forums, and web applications.</p>
<p>The user is there to consume content or get a task done. Unless you're looking to be creative, the average user doesn't know, and doesn't care, what typeface it has so long as it's legible.</p>
<p>Meanwhile, they may care for other things impacted by your font choices…</p>
<h3 id="heading-performance">Performance</h3>
<p>Whether we're talking about embedding fonts in offline documents, or fetching fonts on the web, it increases the overall size and load time of resources.</p>
<p>Typefaces can be upwards of 160 KB per font face. The impact of this can be significant on slower networks or old mobile devices.</p>
<p>Particularly on the web, you'd derive more value building a lightning-fast user experience, than fetching a typeface the user didn't ask for.</p>
<p>Until the typeface has finished fetching, sites can choose to block rendering or swap, neither of which is ideal.</p>
<p>Font swapping is when the font changes shortly after visiting the site, leading to a flicker and an increase in <a href="https://web.dev/articles/cls">Cumulative Layout Shift</a>.</p>
<img src="https://www.freecodecamp.org/news/content/images/2023/09/mdn-font-swap.gif" alt="mdn-font-swap" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p><em>A demo of blocking and font swapping on the MDN website. I refreshed with the cache disabled on a high-spec laptop connected to Wi-Fi with no throttling.</em></p>
<img src="https://www.freecodecamp.org/news/content/images/2023/09/out.gif" alt="out" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p><em>A demo of the MDN website using Nimbus Sans, based on Helvetica, instead of external fonts. I refreshed under the same conditions.</em></p>
<p>Dropping external fonts is pretty simple, but can improve load time, reduce bandwidth usage, and avoid font swapping, which all improve your <a href="https://web.dev/articles/vitals">Core Web Vitals</a> and SEO.</p>
<h3 id="heading-privacy">Privacy</h3>
<p>When fetching fonts from a third-party server such as Google Fonts, client information is leaked to the third party. This includes the <a href="https://developer.mozilla.org/en-US/docs/Glossary/IP_Address">IP Address</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/User-Agent">User-Agent</a>, and <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Referer">Referer</a>, among other headers.</p>
<p>Every website that loads a typeface from Google Fonts has given Google the potential to track the visitor. The domain you visited, the time you accessed it, what browser and operating system you're on, and so on. They can form a timeline of the websites you visit from the fonts alone.</p>
<p>Google states that they don't track or store this information. But given the nature of the internet, they inevitably must receive it.</p>
<p>A German court has actually ruled that websites that load Google Fonts are violating GDPR:</p>
<blockquote>
<p>"A regional court in the German city of Munich has ordered a website operator to pay €100 in damages for transferring a user's personal data — i.e., IP address — to Google via the search giant's Fonts library without the individual's consent." (Source: <a href="https://thehackernews.com/2022/01/german-court-rules-websites-embedding.html">German Court Rules Websites Embedding Google Fonts Violates GDPR</a>)</p>
</blockquote>
<p>This problem can be avoided by self-hosting fonts. If you're going to use an external font, make sure you consider this.</p>
<p>But you should also know that some users <a href="https://support.mozilla.org/en-US/kb/change-fonts-and-colors-websites-use#w_custom-fonts">disable custom fonts</a> or <a href="https://github.com/gorhill/uBlock/wiki/Per-site-switches#no-remote-fonts">block third-party fonts</a>, so you should still specify at least a generic family name regardless.</p>
<blockquote>
<p>"You should always include at least one generic family name in a <code>font-family</code> list, since there's no guarantee that any given font is available. This lets the browser select an acceptable fallback font when necessary.‌‌‌‌‌‌‌‌" (Source: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-family#try_it">MDN Documentation for font-family</a>)</p>
</blockquote>
<h3 id="heading-familiarity">Familiarity</h3>
<p>Users are familiar with the experience of their operating system.</p>
<p>Maybe not how it works under the hood, or even how to perform simple operations, but they do encounter the welcome screen, context menus, and their preinstalled applications regularly.</p>
<p>It's safer to stick with typefaces the user already has access to because these are the typefaces the user is already accustomed to reading from.</p>
<p>This argument is in a similar vein to why it's a good idea to use the system date picker, color picker, or modal/dialog boxes instead of creating custom ones.</p>
<p>Users are familiar with their system!</p>
<p>From my experience, often one of the following occurs:</p>
<ul>
<li><p>The user couldn't tell that an external font was used, making it largely redundant. Most non-specialists experience this everyday, it's hard to even tell that websites are using different fonts from each other unless you're conscious of it.</p>
</li>
<li><p>The user was able to tell, and thus has a different reading experience than what they're used to. The potential for disruption depends on the needs of the user, but that risk is often unnecessary.</p>
</li>
</ul>
<p>Unless you have a reason to change it, it's best to stick with what the user is familiar with.</p>
<h2 id="heading-who-else-does-this">Who Else Does This?</h2>
<p>Wikipedia is the most notable example, and they even have a page elaborating on the topic: <a href="https://en.wikipedia.org/wiki/Wikipedia:Typography">Meta page on Wikipedia's use of typography</a>.</p>
<p>Some of the most popular sites don't fetch a single font on their landing page, in favor of using system fonts only:</p>
<table>
<thead>
<tr>
<th>Site</th>
<th>Font Stack</th>
</tr>
</thead>
<tbody><tr>
<td>Instagram</td>
<td><code>-apple-system,&nbsp;BlinkMacSystemFont,&nbsp;"Segoe UI",&nbsp;Roboto,&nbsp;Helvetica,&nbsp;Arial,&nbsp;sans-serif</code></td>
</tr>
<tr>
<td>Wikipedia</td>
<td><code>-apple-system,&nbsp;'BlinkMacSystemFont',&nbsp;'Segoe UI',&nbsp;'Roboto',&nbsp;'Inter',&nbsp;'Helvetica',&nbsp;'Arial',&nbsp;sans-serif</code></td>
</tr>
<tr>
<td>Reddit</td>
<td><code>-apple-system,&nbsp;BlinkMacSystemFont,&nbsp;"Segoe UI",&nbsp;Roboto,&nbsp;"Helvetica Neue",&nbsp;Arial,&nbsp;"Apple Color Emoji",&nbsp;"Segoe UI Emoji",&nbsp;"Segoe UI Symbol",&nbsp;sans-serif</code></td>
</tr>
<tr>
<td>Bing</td>
<td><code>"-apple-system",&nbsp;HelveticaNeue,&nbsp;Roboto,&nbsp;Arial,&nbsp;sans-serif</code></td>
</tr>
</tbody></table>
<p>You can verify for yourself by inspecting the site with your browser's development tools.</p>
<p>There are no outgoing network requests for fonts, and the <code>font-family</code> properties are set to system fonts only.</p>
<h2 id="heading-exceptions">Exceptions</h2>
<p>There are times loading and embedding fonts does make sense, particularly if the look and feel you're after is significantly different from common system fonts:</p>
<ul>
<li><p>You're targeting an environment that doesn't have typefaces available.</p>
</li>
<li><p>To fit with existing branding, like an in-house font.</p>
</li>
<li><p>A creative or unique design, especially relevant for gaming and artsy sites.</p>
</li>
<li><p>Icon fonts like <a href="https://openmoji.org">OpenMoji</a>, but note that most clients come with emojis already.</p>
</li>
<li><p>A website that's literally for distributing, displaying, and testing fonts.</p>
</li>
</ul>
<h2 id="heading-consequences">Consequences</h2>
<p>If you apply a local font stack, your text content may not look pixel-for-pixel identical across clients. But you should measure success by the user experience.</p>
<p>It's important for the site to feel familiar, but there are more significant changes between clients already, like the human-interface, resolutions, and DPI.</p>
<p>Compared to this, it's fine if the arch of the <code>a</code> has a slightly different radius, or the tick on the <code>l</code> is a few pixels longer. In fact, this is unlikely to get noticed, so it's unlikely to impact the user experience at all.</p>
<p>Users would sooner have qualms with the difference in speed or a flicker, before the difference between similar typefaces.</p>
<p>Another argument is that allowing different typefaces may make the layout difficult to manage. Glyphs can have different widths, and therefore take up varying space.</p>
<p>But modern sites should be following <a href="https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/CSS_layout/Responsive_Design">responsive design</a>, so you should be taking the time to make the pages fluid anyway.</p>
<p>To minimize impact, you can use <a href="https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Text_styling/Fundamentals#web_safe_fonts">web safe fonts</a>.</p>
<p>If you dislike how limiting that is, pick a typeface included with your operating system, and find similar typefaces on other operating systems.</p>
<p>Even better if you can pick <a href="https://en.wikipedia.org/wiki/Typeface#Font_metrics">metrically compatible typefaces</a>.</p>
<h3 id="heading-comparison">Comparison</h3>
<p>Let's visit a website and see what it's like to disable downloadable fonts.</p>
<p>I'll also replace all font stacks to use Helvetica.</p>
<p>Note, my computer doesn't actually have Helvetica installed, so my operating system automatically translates this to Nimbus Sans, which is based on Helvetica. Nimbus Sans is preinstalled on <a href="https://www.debian.org">Debian</a>.</p>
<p>In the case of MDN, is the second version really so undesirable that we need to load a 252 KB font, given the penalties and demonstrations raised above? Ultimately, this one is down to user preference, so I'll let you decide.</p>
<img src="https://www.freecodecamp.org/news/content/images/2023/09/1.png" alt="1" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p><em>MDN, with the Inter typeface fetched from client-side.</em></p>
<img src="https://www.freecodecamp.org/news/content/images/2023/09/1-1.png" alt="1-1" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p><em>MDN, with the font-family overridden to use Helvetica.</em></p>
<p>On the flip side, that doesn't mean to never fetch fonts. There are examples where the aesthetic may be more valuable to the user experience than the performance penalty.</p>
<p>Let's look at <a href="https://framasoft.org">Framasoft</a>. They went for a more creative look and feel, also featuring a lot of <a href="https://www.davidrevoy.com">David Revoy's</a> illustrations.</p>
<p>Using Tovari Sans was a design choice which enhances the user experience, and isn't easily replaceable with a local font stack.</p>
<p>If we were to take that font away, the page feels inconsistent and unpolished. Even if we cleaned up the CSS, we'd still be detracting from the theme of the website.</p>
<img src="https://www.freecodecamp.org/news/content/images/2023/09/1-2.png" alt="1-2" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p><em>Framasoft, with the Tovari Sans typeface fetched from client-side.</em></p>
<img src="https://www.freecodecamp.org/news/content/images/2023/09/1-4.png" alt="1-4" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p><em>Framasoft, with the font-family overridden to use Helvetica.</em></p>
<h2 id="heading-resources">Resources</h2>
<p>Whether you want to go local, or just need to specify some fallback fonts, here are some helpful resources for picking out your font stack:</p>
<ul>
<li><p><a href="https://developer.apple.com/fonts/system-fonts/">List of typefaces included with Apple operating systems</a></p>
</li>
<li><p><a href="https://learn.microsoft.com/en-us/typography/fonts/windows_11_font_list#introduction">List of typefaces included with Windows</a></p>
</li>
<li><p><a href="https://en.wikipedia.org/wiki/Croscore_fonts">Core typefaces included with ChromeOS</a></p>
</li>
<li><p><a href="https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Text_styling/Fundamentals#web_safe_fonts">Documentation for web safe fonts</a></p>
</li>
</ul>
<h2 id="heading-cross-platform-font-stacks">Cross-Platform Font Stacks</h2>
<p>There are countless articles and resources available online that feature predefined font lists you can use. These are referred to as <em>"font stacks"</em>.</p>
<p>In particular, I'd like to highlight a resource by <a href="https://danklammer.com">Dan Klammer</a>, a designer and web developer who created <a href="https://modernfontstacks.com">Modern Font Stacks</a> (<a href="https://github.com/system-fonts/modern-font-stacks">GitHub repository</a>), a website that helps you pick out native font stacks for your project.</p>
<p>Modern Font Stacks proposes a list of fonts for a variety of styles like Neo-Grotesque (a style of sans-serif) or Monospace Code (a style of monospace) and offers a visualization of how it will look across operating systems. It runs through a description of each stack, the CSS to use it, metadata like the weights available, and which of the fonts you personally have installed.</p>
<p>Some font classifications don't explicitly include a font from every operating system that exists, but remember that the generic font family (<code>sans-serif</code>, <code>serif</code>, <code>monospace</code>, <code>cursive</code>, and so on) at the end will have you covered.</p>
<p>If you like the stack, you can run with it. But don't feel constrained either, you can also use it as a starting point and tweak the font stack to your needs.</p>
<p>I've included images from the GitHub repository (at the time of writing), featuring proposed font stacks for two of the most common styles used on the internet today:</p>
<img src="https://www.freecodecamp.org/news/content/images/2024/05/neo-grotesque.png" alt="neo-grotesque" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p><em>Base font stack proposed by Modern Font Stacks for the Neo-Grotesque style, a type of sans-serif font.</em></p>
<img src="https://www.freecodecamp.org/news/content/images/2024/05/monospace-code.png" alt="monospace-code" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p><em>Base font stack proposed by Modern Font Stacks for the Monospace Code style, a type of monospace font.</em></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In the end, the user experience is what matters most. Sometimes that means prioritizing visual design, other times that means prioritizing performance.</p>
<p>I hope this was worth your time, and that with the knowledge you can make an informed decision when choosing fonts for your next project.</p>
<p>Feedback and questions welcome, you can hit me up on <a href="https://github.com/SethFalco">GitHub</a> or <a href="https://fosstodon.org/@sethi">Mastodon</a>.</p>
<p><em>Cover art illustrated by</em> <a href="https://hashrock.info"><em>hashrock</em></a> <em>and released under</em> <a href="https://creativecommons.org/licenses/by/4.0/"><em>CC BY 4.0</em></a><em>.</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Change Font with HTML ]]>
                </title>
                <description>
                    <![CDATA[ Back in the days of HTML4, there was a <font> tag you could use to change the font size, font family, and the color of a text. But with HTML5, the <font> tag has been deprecated. So if you want to change anything related to the font, you have to ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-change-font-with-html/</link>
                <guid isPermaLink="false">66adf1016f5e63db3fc4360b</guid>
                
                    <category>
                        <![CDATA[ fonts ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Design ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Tue, 07 Jun 2022 16:41:40 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/06/abc-3523454_1280.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Back in the days of HTML4, there was a <code>&lt;font&gt;</code> tag you could use to change the font size, font family, and the color of a text.</p>
<p>But with HTML5, the <code>&lt;font&gt;</code> tag has been deprecated. So if you want to change anything related to the font, you have to do it with CSS.</p>
<p>In this article, I will show you how to change the font size, font weight, font style, and font family of text using CSS. </p>
<h2 id="heading-how-to-change-the-font-size-of-text">How to Change the Font Size of Text</h2>
<p>The font size of text represents how big that text is. </p>
<p>To change the font size of some text, you need to use the <code>font-size</code> property and then specify the value in pixels (<code>px</code>), <code>rem</code>, or <code>em</code>.</p>
<p>You can do it using inline CSS like this: </p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"font-size: 4rem"</span>&gt;</span>freeCodeCamp<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
</code></pre>
<p>You can also do it in embedded or internal CSS: </p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">style</span>&gt;
    <span class="hljs-selector-tag">h1</span> {
        <span class="hljs-attribute">font-size</span>: <span class="hljs-number">4rem</span>;
    }
&lt;/<span class="hljs-selector-tag">style</span>&gt;
</code></pre>
<p>And finally you can do it in external CSS:</p>
<pre><code class="lang-css">    <span class="hljs-selector-tag">h1</span> {
        <span class="hljs-attribute">font-size</span>: <span class="hljs-number">4rem</span>;
    }
</code></pre>
<p>To get rid of the default white background and center the text both horizontally and vertically, I wrote this CSS:</p>
<pre><code class="lang-css">  <span class="hljs-selector-tag">body</span> {
      <span class="hljs-attribute">display</span>: flex;
      <span class="hljs-attribute">align-items</span>: center;
      <span class="hljs-attribute">justify-content</span>: center;
      <span class="hljs-attribute">height</span>: <span class="hljs-number">100vh</span>;
      <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#f1f1f1</span>;
    }
</code></pre>
<p>In the browser, it looks as shown below: 
<img src="https://www.freecodecamp.org/news/content/images/2022/06/ss1-2.png" alt="ss1-2" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-change-the-font-weight-of-text">How to Change the Font-weight of Text</h2>
<p>Font-weight is the property that helps set how bold or light specific text will be.</p>
<p>You can use <code>font-weight</code> to change the lightness or boldness of text, then give it a value such as <code>normal</code>, <code>lighter</code>, <code>bold</code>, or <code>bolder</code>. You can also use values like 100, 200, 500, and so on.</p>
<p>Just like font size, you can change the font-weight in inline, embedded, or external CSS.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">span</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"font-weight: lighter"</span>&gt;</span>freeCodeCamp Lighter<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"font-weight: normal"</span>&gt;</span>freeCodeCamp Normal<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bold"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"font-weight: bold"</span>&gt;</span>freeCodeCamp Bold<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"font-weight: bolder"</span>&gt;</span>freeCodeCamp Bolder<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
</code></pre>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">style</span>&gt;
    <span class="hljs-selector-class">.lighter</span> {
      <span class="hljs-attribute">font-weight</span>: lighter;
    }

    <span class="hljs-selector-class">.normal</span> {
      <span class="hljs-attribute">font-weight</span>: normal;
    }

    <span class="hljs-selector-class">.bold</span> {
      <span class="hljs-attribute">font-weight</span>: bold;
    }

    <span class="hljs-selector-class">.bolder</span> {
      <span class="hljs-attribute">font-weight</span>: bolder;
    }
&lt;/<span class="hljs-selector-tag">style</span>&gt;
</code></pre>
<pre><code class="lang-css"><span class="hljs-selector-class">.lighter</span> {
      <span class="hljs-attribute">font-weight</span>: lighter;
    }

    <span class="hljs-selector-class">.normal</span> {
      <span class="hljs-attribute">font-weight</span>: normal;
    }

    <span class="hljs-selector-class">.bold</span> {
      <span class="hljs-attribute">font-weight</span>: bold;
    }

    <span class="hljs-selector-class">.bolder</span> {
      <span class="hljs-attribute">font-weight</span>: bolder;
    }
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/06/ss2-2.png" alt="ss2-2" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-change-the-font-style-of-text">How to Change the Font Style of Text</h2>
<p>Font style is the typeface variation of the text. This typeface variation could be <code>normal</code>, <code>bold</code>, or <code>italic</code>.</p>
<p>To change the font style, you need the font-style property with a value of <code>normal</code>, <code>oblique</code>, or <code>italic</code>.</p>
<p>Normal is the default font style, so you don’t need to specify it unless you have to override it.</p>
<p>As usual, you can change the font style in inline, internal, or external CSS.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">span</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>freeCodeCamp Normal<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"font-style: oblique"</span>&gt;</span>freeCodeCamp Oblique<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"font-style: italic"</span>&gt;</span>freeCodeCamp Italic<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
</code></pre>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">style</span>&gt;
    <span class="hljs-selector-class">.oblique</span> {
      <span class="hljs-attribute">font-style</span>: oblique;
    }

    <span class="hljs-selector-class">.italic</span> {
      <span class="hljs-attribute">font-style</span>: italic;
    }
&lt;/<span class="hljs-selector-tag">style</span>&gt;
</code></pre>
<pre><code class="lang-css">    <span class="hljs-selector-class">.oblique</span> {
      <span class="hljs-attribute">font-style</span>: oblique;
    }

    <span class="hljs-selector-class">.italic</span> {
      <span class="hljs-attribute">font-style</span>: italic;
    }
</code></pre>
<p>Here's the output in the browser:
<img src="https://www.freecodecamp.org/news/content/images/2022/06/ss3-2.png" alt="ss3-2" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-change-the-font-family-of-text">How to Change the Font Family of Text</h2>
<p>A font family represents a collection of fonts that share the same design and typography. </p>
<p>To change the font family of some text, you need to use the CSS <code>font-family</code> property.</p>
<p>You can then choose to do it with inline CSS, internal CSS, or external CSS. </p>
<p>The code snippet below shows how to change the font-family in inline CSS:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"font-family: Verdana, Geneva, Tahoma, sans-serif"</span>&gt;</span>
      freeCodeCamp
<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>


You can change the font-family in embedded or internal CSS this way:

```css
<span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><span class="css">
    <span class="hljs-selector-tag">h1</span> {
      <span class="hljs-attribute">font-family</span>: Verdana, Geneva, Tahoma, sans-serif;
    }
</span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span>
</code></pre>
<p>In an external CSS file you can change the font family like this:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">h1</span> {
      <span class="hljs-attribute">font-family</span>: Verdana, Geneva, Tahoma, sans-serif;
    }
</code></pre>
<p>Make sure the external CSS is linked to the HTML file, otherwise it won’t work.</p>
<p>The Verdana font family looks like this inside the Google Chrome browser:
<img src="https://www.freecodecamp.org/news/content/images/2022/06/ss4-1.png" alt="ss4-1" width="600" height="400" loading="lazy"></p>
<p>You might have noticed that there are other font families in the value – Geneva, Tahoma, and sans-serif. </p>
<p>Those are fallbacks the browser can use in case Verdana is not available on the user’s device.</p>
<p>If you don’t like the fonts built into your device, you can get other ones from Google Fonts.</p>
<p>Search for your favorite font and copy the link to it, then paste the link in the <code>&lt;head&gt;</code> section of your HTML so you can have access to it in your HTML stylesheet 
 <img src="https://www.freecodecamp.org/news/content/images/2022/06/ss5-1.png" alt="ss5-1" width="600" height="400" loading="lazy"></p>
<p>In my case, I used the Roboto font like this:</p>
<pre><code class="lang-css"> <span class="hljs-selector-tag">h1</span> {
      <span class="hljs-attribute">font-family</span>: Roboto, sans-serif;
    }
</code></pre>
<p>And this is how it looks in the browser:
<img src="https://www.freecodecamp.org/news/content/images/2022/06/ss6-1.png" alt="ss6-1" width="600" height="400" loading="lazy"></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>This article walked you through how to change the font size, font weight, font style, and font family of text in inline, internal, or external CSS.</p>
<p>You might be wondering which is best to use between inline, internal, or external CSS.</p>
<p>If you’re working on a small project, you can use internal or embedded CSS, but if you’re working on a big project or in a team, you should not use internal CSS.</p>
<p>This is because it is a best practice to keep your CSS away from your HTML.</p>
<p>Inline CSS is a no-no in most situations because it might affect the readability of your HTML.</p>
<p>It’s also been suggested that inline CSS can negatively affect the SEO of a website.</p>
<p>Thank you for reading.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ HTML Font Size – How to Change Text Size Using Inline CSS Style ]]>
                </title>
                <description>
                    <![CDATA[ In HTML, the font you choose will play a major role in the look and feel of your web pages.  You get to pick the font's color, weight, size, and so on. And all these features make your websites and apps look better and more presentable to the user. ]]>
                </description>
                <link>https://www.freecodecamp.org/news/html-font-size-how-to-change-text-size-using-inline-css-style/</link>
                <guid isPermaLink="false">66adf168febac312b73075bc</guid>
                
                    <category>
                        <![CDATA[ CSS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ fonts ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Design ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Wed, 22 Sep 2021 18:02:22 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/09/fontsize-.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>In HTML, the font you choose will play a major role in the look and feel of your web pages. </p>
<p>You get to pick the font's color, weight, size, and so on. And all these features make your websites and apps look better and more presentable to the user.</p>
<p>With the <code>font-size</code> property in CSS, you can change how big or small the text is on the web page. You can use this property in any type of CSS you are writing – external, internal, or inline.</p>
<p>In this article, I will show you how to change the size of the text with the <code>font-size</code> property in inline CSS.</p>
<h2 id="heading-what-is-inline-css">What is inline CSS?</h2>
<p>Inline CSS is one of the three different ways you can use to style any HTML element. </p>
<p>Instead of targeting the element with a class or id attribute, or the element itself as the selector and styling it with that, you put all the CSS styles in the opening tag. </p>
<p>In addition, you have to make sure all the properties and values of your stylings are inside the <code>style</code> attribute. This <code>style</code> attribute is one of the numerous attributes accepted by all HTML tags.</p>
<p>In the example below, I change the background color of the text to crimson, the text color to <code>#f1f1f1</code> (light-grey), and the font-weight to <code>bold</code> with inline CSS.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"background-color: crimson; color: #f1f1f1; font-weight: bold"</span>&gt;</span>
      Hello Campers...
<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/inline-styling-example.png" alt="inline-styling-example" width="600" height="400" loading="lazy"></p>
<p>By the way, my browser is zoomed-in to a level of 400% which is why everything appears so big. I didn’t apply any additional styles to accomplish that :)</p>
<h2 id="heading-how-to-change-text-size-using-inline-css">How to Change Text Size Using Inline CSS</h2>
<p>To change the size of your text with inline CSS, you have to do it with the <code>style</code> attribute. You type in the <code>font-size</code> property, and then assign it a value. </p>
<p>There are built-in values such as <code>large</code>, <code>larger</code>, <code>medium</code>, <code>small</code>, <code>x-large</code>, and so on:
<img src="https://www.freecodecamp.org/news/content/images/2021/09/inbuilt-properties.png" alt="inbuilt-properties" width="600" height="400" loading="lazy"> </p>
<p>In the code snippet below, I change the size of the “Hello Campers…” text to x-large, one of the built-in values of the font-size property.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"font-size: x-large"</span>&gt;</span>Hello Campers...<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/font-style-with-inbuilt-value.png" alt="font-style-with-inbuilt-value" width="600" height="400" loading="lazy"></p>
<p>You can also set the value of the <code>font-size</code> property using a number with any unit such as pixels (px), rem, or em. </p>
<p>It’s better to go with numbered values because they give you more freedom to pick any font size you want.</p>
<p>In the code snippet below, I changed the size of the text to <code>30px</code> with inline CSS:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"font-size: 30px"</span>&gt;</span>Hello Campers...<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/font-style-with-numbered-value.png" alt="font-style-with-numbered-value" width="600" height="400" loading="lazy"></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In this article, you learned how to change text size with inline CSS and the font-size property. You also saw how you can assign values to the font-size property. </p>
<p>Just a heads up, though: inline CSS is great for styling, but you should not rely heavily on it as it makes your HTML hard to read, especially if you are working in a team. You don’t want to be the only one who will be able to read your own code. </p>
<p>Be aware that it also overrides any styling set with internal or external styling. You should use external style or internal style instead, as they make your HTML and CSS codes separate, which is better for readability. </p>
<p>While assigning values to the <code>font-size</code> property, it is better to assign the values in rem units instead of <code>px</code>, for example. This is because when you use <code>rem</code>, the browser will be able to make font size adjustments as the user zooms in or out, which won't happen when you use <code>px</code>.</p>
<p>Thank you for reading, and keep coding.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ CSS Font Color – How to Style Text in HTML ]]>
                </title>
                <description>
                    <![CDATA[ Setting text color on a website you're building might be confusing at first. But in this article, you'll learn how to do it. How to Set Text Color in HTML In CSS, the background-color property is pretty straightforward for setting the background colo... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/css-font-color-how-to-style-text-in-html/</link>
                <guid isPermaLink="false">66adf09bfebac312b730759f</guid>
                
                    <category>
                        <![CDATA[ colors ]]>
                    </category>
                
                    <category>
                        <![CDATA[ CSS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ fonts ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Wed, 01 Sep 2021 17:27:17 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/09/Cssfontcolor.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Setting text color on a website you're building might be confusing at first. But in this article, you'll learn how to do it.</p>
<h2 id="heading-how-to-set-text-color-in-html">How to Set Text Color in HTML</h2>
<p>In CSS, the <code>background-color</code> property is pretty straightforward for setting the background color of anything. </p>
<p>So what if you want to set the foreground color of something on the page? Especially text, which under normal conditions you wouldn't want to set a background color for. </p>
<p>There's no <code>foreground-color</code> property in CSS, so what makes this possible is the <code>color</code> property.</p>
<p>In this article, I will walk you through how to set the color of text using the color property. We'll also look at the various ways it takes values.</p>
<p>The color property takes values in 4 different ways: named color, hexadecimal color, RGB color, and HSL color. Let's look at each one now.</p>
<h2 id="heading-named-colors">Named Colors</h2>
<p>As the name implies, you bring in the color property and apply the value by naming the color you want. This may be red, green, blue, orange, crimson, cyan, or any other named color. There are around 147 named colors recognized by browsers. </p>
<p>The basic syntax looks like this:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">element</span> {
    <span class="hljs-attribute">color</span>: colorName
}
</code></pre>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>freeCodeCamp<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<pre><code class="lang-css"> <span class="hljs-selector-tag">p</span> {
     <span class="hljs-attribute">color</span>: crimson;
}
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/named-color.png" alt="named-color" width="600" height="400" loading="lazy"></p>
<h2 id="heading-hexadecimal-colors-or-just-hex-colors">Hexadecimal Colors (or just Hex Colors)</h2>
<p>Hex values are used to represent colors with a total of 6 characters. They start with the pound/number sign (#), then any number from 0 to 9, and finally any letter from A to F.</p>
<p>The first 2 values stand for red, the next two stand for green, and the last 2 represent blue. With hex values, there's no limit to the shades of colors you can use.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>freeCodeCamp<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<pre><code class="lang-css"> <span class="hljs-selector-tag">p</span> {
    <span class="hljs-attribute">color</span>: <span class="hljs-number">#dc143c</span>;
 }
</code></pre>
<h2 id="heading-rgb-colors">RGB Colors</h2>
<p>RGB stands for red, green, and blue. With RGB colosr, you specify the color in terms of how much red, green, and blue you want. All three are expressed with numbers between 0 and 255.</p>
<p>There is a type of RGB called <code>rgba</code>. The extra ‘a’ stands for alpha, which lets you specify the opacity of the color. It takes a value from 0.0 to 1.0 – 0.0 means 0% opacity, 0.5 means 50% opacity, and 1.0 means 100% opacity.</p>
<p>The basic syntax is <code>rgba(amountOfRed, amountOfGreen, amountOfBlue, alpha)</code>. </p>
<p>You can limit it to <code>rgba(amountOfRed, amountOfGreen, amountOfBlue)</code> if you don't want an alpha value.</p>
<p>Here's the syntax for the regular RGB values:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>freeCodeCamp<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<pre><code class="lang-css"> <span class="hljs-selector-tag">p</span> {
   <span class="hljs-attribute">color</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">220</span>, <span class="hljs-number">20</span>, <span class="hljs-number">60</span>);
 }
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/rgb-color.png" alt="rgb-color" width="600" height="400" loading="lazy"></p>
<p>And here it is demonstrating the alpha value in action with 50% (0.5) opacity:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span> {
    <span class="hljs-attribute">color</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">219</span>, <span class="hljs-number">20</span>, <span class="hljs-number">60</span>, <span class="hljs-number">0.5</span>);
}
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/rgb-fifty-percent-opacity.png" alt="rgb-fifty-percent-opacity" width="600" height="400" loading="lazy"></p>
<h2 id="heading-hsl-colors">HSL Colors</h2>
<p>HSL stands for hue, saturation, and lightness. It is another way of specifying color for text (and anything else that takes color) in CSS. </p>
<ul>
<li>Hue represents the color wheel in 360°. So, 0° is red, 120° is green and 240° is blue. </li>
<li>Saturation is the amount of gray in the color, expressed as a percentage. 0% is the shade of gray and 100% is the color itself.</li>
<li>Lightness is the amount of darkness and lightness in the color expressed as a percentage. 0% is black and 100% is white.</li>
</ul>
<p>Just like the RGB colors, you can also set the opacity of the color. So, there's also hsla.</p>
<p>The full basic syntax is <code>hsl(colorDegree, saturationPercentage, lightnessPercentage, alpha)</code>. You can limit it to <code>hsl(colorDegree, saturationPercentage, lightnessPercentage)</code> in case you don't want an alpha value.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>freeCodeCamp<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<pre><code class="lang-css"> <span class="hljs-selector-tag">p</span> {
   <span class="hljs-attribute">color</span>: <span class="hljs-built_in">hsl</span>(<span class="hljs-number">348</span>, <span class="hljs-number">83%</span>, <span class="hljs-number">47%</span>);
 }
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/hsl-color.png" alt="hsl-color" width="600" height="400" loading="lazy"></p>
<p>You can apply a particular opacity to the hsl color like this:</p>
<pre><code class="lang-css"> <span class="hljs-selector-tag">p</span> {
   <span class="hljs-attribute">color</span>: <span class="hljs-built_in">hsla</span>(<span class="hljs-number">348</span>, <span class="hljs-number">83%</span>, <span class="hljs-number">47%</span>, <span class="hljs-number">0.5</span>);
  }
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/hsl-fifty-percent-opacity-1.png" alt="hsl-fifty-percent-opacity-1" width="600" height="400" loading="lazy"></p>
<h2 id="heading-should-you-use-named-colors-hex-colors-rgb-colors-or-hsl-colors-to-assign-colors">Should You Use Named Colors, Hex Colors, RGB Colors, or HSL Colors to Assign Colors?</h2>
<p>One of the wonderful things about CSS is that there are multiple ways of doing the same thing. You've seen this by applying colors to text. </p>
<p>Since you can apply colors in 4 different ways, you must be wondering which is the best to use.</p>
<p>When you use named colors, you're kind of limited in how far you can go in applying different shades of colors. Red, green, blue, yellow, or any other named color has a lot of variations you won't get access to with named colors. You'll only have access to around 147 predefined colors recognized by browsers.</p>
<p>Hexadecimal colors are very dynamic. They are the most commonly used among developers because your limit is your creativity. With hex colors, you can use various shades and even use a color no one has ever used.</p>
<p>RGB colors are as dynamic as hex colors. Apart from being able to specify how much red, green, and blue you want from 0 to 255, you can also set how transparent you want the color to be with the extra alpha value.</p>
<p>HSL is the most dynamic of all. You get to specify the exact color you want in degrees from 0 to 360 within the color wheel, set how saturated and dark you want it to be in percentages, and also set an opacity from 0.0 to 1.0.</p>
<p>So really, it's up to you and your use case – and just how creative or specific you want to get.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Applying colors to text helps make your website more attractive to visitors. The right color combo can also help your content become more readable too. </p>
<p>In this article, you have learned how to apply colors to text with the 4 different kinds of values you can use with the color property.</p>
<p>Thank you for reading, and keep coding.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Bold Font in HTML – Font Weight for Letters ]]>
                </title>
                <description>
                    <![CDATA[ When you're building a website, you may want to place particular emphasis on certain text to let users know that it's important.  And you can do this in HTML with various text formatting tags.  In this article, I will take you through how to emphasiz... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/bold-font-in-html-font-weight-for-letters/</link>
                <guid isPermaLink="false">66adf077f452caf50fb1fdd2</guid>
                
                    <category>
                        <![CDATA[ fonts ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Tue, 31 Aug 2021 20:35:21 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/08/boldfont.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>When you're building a website, you may want to place particular emphasis on certain text to let users know that it's important. </p>
<p>And you can do this in HTML with various text formatting tags. </p>
<p>In this article, I will take you through how to emphasize certain text by making it bold.</p>
<p>In HTML, there are three major ways that you can use to make text bold. You can use the <code>&lt;b&gt;</code> tag, the <code>&lt;strong&gt;</code> tag, or you can do it in CSS with the <code>font-weight</code> property. Let's look at each method in more detail.</p>
<h2 id="heading-how-to-make-text-bold-with-the-tag-in-html">How to Make Text Bold With the <code>&lt;b&gt;</code> Tag in HTML</h2>
<p>HTML gives us the <code>&lt;b&gt;</code> tag for making text bold. To make text bold with this tag, you need to wrap it around the text like this:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">b</span>&gt;</span>This text is bold<span class="hljs-tag">&lt;/<span class="hljs-name">b</span>&gt;</span>, but this text is not.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/bold-with-b-tag.png" alt="bold-with-b-tag" width="600" height="400" loading="lazy"></p>
<p>As you can see in the image, the tag makes part of the text stand out.</p>
<h2 id="heading-how-to-make-text-bold-with-the-tag-in-html-1">How to Make Text Bold With the <code>&lt;strong&gt;</code> Tag in HTML</h2>
<p>With the <code>&lt;strong&gt;</code> tag, you are not just making the text bold – you are calling special attention to it. </p>
<p><code>&lt;strong&gt;</code> also makes text bold just like the <code>&lt;b&gt;</code> tag, but there is a slight difference between the two. I'll discuss this later in the article.</p>
<p>Just like the <code>&lt;b&gt;</code> tag, you need to wrap the <code>&lt;strong&gt;</code> tag around the text to make the text bold with it. </p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>
   Before paying to learn programming, check out
   <span class="hljs-tag">&lt;<span class="hljs-name">strong</span>&gt;</span>freeCodeCamp<span class="hljs-tag">&lt;/<span class="hljs-name">strong</span>&gt;</span>.
<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/bold-with-strong-tag.png" alt="bold-with-strong-tag" width="600" height="400" loading="lazy"></p>
<p>With the <code>&lt;strong&gt;</code> tag, the <code>freeCodeCamp</code> text isn’t just bold, it has a semantic meaning and emphasis.</p>
<h2 id="heading-how-to-make-text-bold-with-the-css-font-weight-property">How to Make Text Bold with the CSS <code>font-weight</code> Property</h2>
<p>The font-weight property takes <code>lighter</code>, <code>bold</code>, and <code>bolder</code> as values. It also takes numbers from 100 to 900. So, with it, you don't just make text bold, you can also make it lighter than its surrounding text.</p>
<p>To make some text bold with the font-weight weight property, you need to select the text with its class, id (if any), or element and then apply the values you want. Here's how it works:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>This is a <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"lighter"</span>&gt;</span>lighter text<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>This is a <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bold"</span>&gt;</span>bold text<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>This is a <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"bolder"</span>&gt;</span>bolder text<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<pre><code class="lang-css"> <span class="hljs-selector-class">.lighter</span> {
    <span class="hljs-attribute">font-weight</span>: lighter;
}

<span class="hljs-selector-class">.bold</span> {
    <span class="hljs-attribute">font-weight</span>: bold;
}

<span class="hljs-selector-class">.bolder</span> {
    <span class="hljs-attribute">font-weight</span>: bolder;
}
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/bold-with-fontweight.png" alt="bold-with-fontweight" width="600" height="400" loading="lazy"></p>
<h2 id="heading-should-you-use-or-font-weight-to-make-text-bold">Should You Use <code>&lt;b&gt;</code>, <code>&lt;strong&gt;</code> or <code>font-weight</code> to Make Text Bold?</h2>
<p>You might be wondering which to use for making text bold – <code>&lt;b&gt;</code>, <code>&lt;strong&gt;</code>, or the CSS <code>font-weight</code> property. </p>
<p>You should generally avoid using <code>&lt;b&gt;</code> because it's already a style. When you make text bold with the <code>&lt;b&gt;</code> tag, you're explicitly telling the browser to make the text bold right from the HTML. </p>
<p><code>&lt;strong&gt;</code> also makes the text appear bold, but it is semantic. With it, you're not styling from the HTML (which HTML was never meant for originally), but rather you're telling the browser to make the text appear stronger in appearance than other surrounding text.</p>
<p>The CSS <code>font-weight</code> property gives you more control over how light or bold the text should be. The values <code>lighter</code>, <code>bold</code>, and <code>bolder</code> are a start, but you can take things a step further by applying numbers/weights like <code>100</code> <code>200</code>, <code>300</code>, <code>400</code>, <code>500</code>, <code>600</code>, <code>700</code>, <code>800</code>, and <code>900</code> as values, which gives different variations of lightness and boldness.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Bold font helps you place emphasis on certain words in HTML. In this article, you've learned about the 3 different ways you can make text bold, as well as which of them is best to use.</p>
<p>Thank you for reading, and keep coding.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ HTML Font – CSS Font Family Example (Serif and Sans Serif Characters) ]]>
                </title>
                <description>
                    <![CDATA[ Choosing the right font is an important first step in making your website usable and accessible. How text is formatted affects how readable your designs and webpages are. You can modify how your HTML text appears in many ways using CSS. You can selec... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/html-font-css-font-family-example-serif-and-sans-serif-characters/</link>
                <guid isPermaLink="false">66b1e4400968943127cc5f0d</guid>
                
                    <category>
                        <![CDATA[ CSS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ fonts ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Dionysia Lemonaki ]]>
                </dc:creator>
                <pubDate>Thu, 26 Aug 2021 22:15:30 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/08/brett-jordan-M9NVqELEtHU-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Choosing the right font is an important first step in making your website usable and accessible.</p>
<p>How text is formatted affects how readable your designs and webpages are.</p>
<p>You can modify how your HTML text appears in many ways using CSS. You can select the type of font you want to use, whether it's bold or not, how big it is, and you can even change the color and add different spacing or decorations to it.</p>
<p>In this article, we'll go over the differences between the two most popular font types, Serif and Sans Serif.</p>
<p>In addition, we'll cover the syntax and how to use the <code>font-family</code> property so that with the help of CSS, you can choose and then use different fonts in your web design projects.</p>
<p>Let's get started!</p>
<h2 id="heading-typeface-terminology">Typeface Terminology</h2>
<p>First, let's discuss some of the most common and frequently used font types that modern browsers support.</p>
<h3 id="heading-the-serif-font-type">The Serif font type</h3>
<p>Serif fonts are characterised by the little extra fine details on the ends of the letters.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/Screenshot-2021-08-13-at-4.34.15-PM.png" alt="Screenshot-2021-08-13-at-4.34.15-PM" width="600" height="400" loading="lazy"></p>
<p>At the end of the main strokes of characters, there are small flourish strokes called <em>serifs</em>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/Screenshot-2021-08-13-at-4.38.02-PM.jpeg" alt="Screenshot-2021-08-13-at-4.38.02-PM" width="600" height="400" loading="lazy"></p>
<p>Serif fonts are traditionally used widely in print as they are considered readable for lengthy passages of text. But they don't always display well on screens.</p>
<p>Serif fonts are considered to be among the most classic, elegant, and traditional fonts you can use.</p>
<h3 id="heading-the-sans-serif-font-type">The Sans-Serif font type</h3>
<p>This type of font creates a clean design look, while at the same time being very readable and clear.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/Screenshot-2021-08-13-at-4.35.04-PM.png" alt="Screenshot-2021-08-13-at-4.35.04-PM" width="600" height="400" loading="lazy"></p>
<p>This font type  has straight ends on each letter and there are no strokes at the edges, making the characters look sharp and flat and with clean lines.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/Screenshot-2021-08-13-at-4.38.14-PM.jpeg" alt="Screenshot-2021-08-13-at-4.38.14-PM" width="600" height="400" loading="lazy"></p>
<p>Sans-serif fonts are considered modern, minimalistic, contemporary and a bit more readable choice for high resolution computer screens.</p>
<h3 id="heading-the-monospace-font-type">The Monospace font type</h3>
<p>With this font type, every letter has the same fixed width and letters are equally spaced apart. </p>
<p>With the previous font types we've discussed so far, each letter has a different width.</p>
<p>So, with the monospace typeface, all letters have the same width. This makes text align nicely and makes it easy to follow, giving designs a clean appearance and mechanical feel.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/Screenshot-2021-08-13-at-5.29.11-PM.png" alt="Screenshot-2021-08-13-at-5.29.11-PM" width="600" height="400" loading="lazy"></p>
<p>There are two more generic font types available, <code>fantasy</code> and <code>cursive</code>, but the most widely used fonts are the ones mentioned above.</p>
<h2 id="heading-how-to-choose-a-font-for-your-website-font-names">How to choose a font for your website – font names</h2>
<p>Now that we've covered the basics of font terms and descriptions, its time to look at the many different font styles within each family.</p>
<p>Some common styles within each font family are listed below:</p>
<h3 id="heading-serif-fonts">Serif Fonts</h3>
<ul>
<li>Georgia</li>
<li>Times</li>
<li>Times New Roman</li>
<li>Bodoni</li>
<li>Garamond</li>
<li>Palatino</li>
<li>ITC Clearface</li>
<li>Plantin</li>
<li>Freight Text</li>
<li>Didot</li>
<li>American Typewriter</li>
</ul>
<h3 id="heading-sans-serif-fonts">Sans-Serif Fonts</h3>
<ul>
<li>Arial</li>
<li>Verdana</li>
<li>Helvetica</li>
<li>Geneva</li>
<li>Tahoma</li>
<li>Trebuchet MS</li>
<li>Open Sans</li>
<li>Liberation Sans</li>
<li>Impact</li>
</ul>
<h3 id="heading-monospace-fonts">Monospace Fonts</h3>
<ul>
<li>Courier</li>
<li>MS Courier New</li>
<li>Monaco</li>
<li>Lucinda Console</li>
<li>Andalé Mono</li>
<li>Menlo</li>
<li>Consolas</li>
</ul>
<h2 id="heading-how-to-use-the-font-family-property">How to use the <code>font-family</code> property</h2>
<p>In CSS, the <code>font-family</code> property defines a specific font for an element and how its text content will look and be rendered.</p>
<p>The syntax for the <code>font-family</code> property is:</p>
<pre><code class="lang-CSS"><span class="hljs-selector-tag">element</span> {
<span class="hljs-attribute">font-family</span>: value;
}
</code></pre>
<p>We write the propepty <code>font-family</code> followed by a colon <code>:</code>, a space, a <code>value</code>, and finally end the specification with a semicolon <code>;</code>.</p>
<p>We have to set the property we want to target and assign the value we want.</p>
<h2 id="heading-how-to-set-a-css-font">How to set a CSS font</h2>
<p>Say we have the HTML below:</p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">http-equiv</span>=<span class="hljs-string">"X-UA-Compatible"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"IE=edge"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1.0"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"style.css"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>CSS Fonts<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>HTML Font – CSS Font Family <span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>I am a paragraph<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p>Without any style applied and without explicitely setting a value to the <code>font-family</code> property, browsers display headings and paragraphs in the font of their own choosing. </p>
<p>The default, standard font used in Google Chrome is <code>Times New Roman</code>, a serif font.</p>
<p>The result looks like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/Screenshot-2021-08-13-at-7.03.34-PM.png" alt="Screenshot-2021-08-13-at-7.03.34-PM" width="600" height="400" loading="lazy"></p>
<p>There are a few ways to set a different typeface and specify the font we want.</p>
<p>When choosing a typeface – that is the <code>value</code> part – it's worth mentioning that sites use a limited set of typefaces. They'll grab fonts that are already installed on the user's computer.</p>
<p>A browser will display a font only if its already installed on a user's computer.</p>
<p>So let's see the ways in which you can set a font in CSS.</p>
<h3 id="heading-how-to-use-a-generic-font-family-name">How to use a generic font-family name</h3>
<p>In this case, the names are keywords and include one of the font categories mentioned earlier (serif, sans-serif, monospace).</p>
<p>It would look something like this:</p>
<pre><code class="lang-CSS"> <span class="hljs-selector-tag">p</span> {
  <span class="hljs-attribute">font-family</span>: serif;
  }
</code></pre>
<p>This sets the font to a generic serif font.</p>
<h3 id="heading-how-to-use-a-specific-font-family-name">How to use a specific font-family name</h3>
<pre><code class="lang-CSS"><span class="hljs-selector-tag">p</span> {
 <span class="hljs-attribute">font-family</span>: Times,serif;
 }
</code></pre>
<p>This rule sets <code>Times</code> as the desired font and then <code>serif</code> as the generic fallback option, in case the first option is not installed on the user's computer.</p>
<p>If the name contains any white space, you need to enclose it in quotation marks.</p>
<pre><code class="lang-CSS"><span class="hljs-selector-tag">p</span> {
<span class="hljs-attribute">font-family</span>: <span class="hljs-string">"Courier New"</span>,monospace;
}
</code></pre>
<p>This sets the font to <code>Courier New</code> and adds <code>monospace</code> as a backup.</p>
<p>If we're specifying a font other than one of the generic names (like serif, sans-serif) we need to give the browser a fallback.</p>
<h3 id="heading-how-to-use-a-font-stack">How to use a font-stack</h3>
<p>In this case, the <code>font-family</code> property has multiple values.</p>
<p>It is a prioritized, comma-separated list of font family names you can apply to text, indicating that all the fonts are alternatives. This makes for maximum browser and operating system compatability.</p>
<p>The list is prioritized from left to right, from highest to lowest priority.</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span> { 
  <span class="hljs-attribute">font-family</span>: <span class="hljs-string">"Lucida Console"</span>, Courier, monospace;
}
</code></pre>
<p>By applying more than one font-family name, you create an order of preference. We start with the font we want first.</p>
<p>If a user doesn't have the first option installed on their computer or if it isn't supported by the browser, the browser moves on to the second font and  uses that one. If that font is also not available it moves to the third one, and so on.</p>
<p>We can list as many fonts as we wish, but best practice is to list three to four.</p>
<p>If all else fails, there will always be a generic font listed at the end as a last option-fallback mechanism.</p>
<p>From the group listed, the browser has to support <em>at least</em> one option and the generic name guarantees that something in the desired font-family will be rendered.</p>
<pre><code class="lang-CSS"><span class="hljs-selector-tag">p</span> {
 <span class="hljs-attribute">font-family</span>: Georgia, <span class="hljs-string">"Times New Roman"</span>, Times, serif;
</code></pre>
<p>The fonts you list are known as a <em>font stack</em>. </p>
<p>The browser will first look for <code>Georgia</code>. If it is installed, the browser will display that font. Overwise it will look for <code>Times New Roman</code>. If that also isn't available, it will resort to displaying the generic default <code>serif</code> family font.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In this article, we went over the different font families and gave some examples of the different styles within each family.</p>
<p>We also went over the <code>font-family</code> property and the three different ways to set a font in CSS.</p>
<p>If you want to learn more about HTML and CSS and the different modern techniques used, freeCodeCamp has a free certification on <a target="_blank" href="https://www.freecodecamp.org/learn/responsive-web-design/">Responsive Web Design</a>.</p>
<p>You'll start from the absolute basics and go up through Flexbox, CSS Grid, and how to make websites resonsive. These are essential skills to have for digital design and front-end web development.</p>
<p>In the end, you'll build 5 projects, including a portfolio site where you can show off the other projects you've built if you want.</p>
<p>Thanks for reading and happy learning.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Use Font Awesome v5.7.2 with HTML ]]>
                </title>
                <description>
                    <![CDATA[ Font Awesome is one of the most popular ways to add icons to your site. But what if you add the CDN to the <head> element of your page and all you see are black rectangles? Here are a couple of things to keep in mind when you add Font ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-use-font-awesome-v5-7-2-with-html/</link>
                <guid isPermaLink="false">66c355acfd47bc6e657cb86e</guid>
                
                    <category>
                        <![CDATA[ fonts ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML ]]>
                    </category>
                
                    <category>
                        <![CDATA[ toothbrush ]]>
                    </category>
                
                    <category>
                        <![CDATA[ typography ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 02 Jun 2020 02:14:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9aa9740569d1a4ca26f1.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Font Awesome is one of the most popular ways to add icons to your site. But what if you add the CDN to the <code>&lt;head&gt;</code> element of your page and all you see are black rectangles?</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/6f22c59bffe7f1b87fed6d58092f69d53e3bbd15.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Here are a couple of things to keep in mind when you add Font Awesome to your next project.</p>
<h3 id="heading-add-the-link-to-the-head">Add the link to the head</h3>
<p>Imagine you have the following HTML:</p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/css"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"testing.css"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/css"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"css/all.css"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1 user-scalable=no"</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fab fa-github-square"</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"https://github.com/willyblackkeez"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"profile-link"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fab fa-facebook"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p>Like other CDNs, you need to add a <code>&lt;link&gt;</code> element to the <code>&lt;head&gt;</code>. For Font Awesome 5.7.2, it'll look something like this: </p>
<p><code>&lt;link rel="stylesheet" href="//use.fontawesome.com/releases/v5.0.7/css/all.css"&gt;</code></p>
<h3 id="heading-online-vs-local">Online vs local</h3>
<p>If you run the following code in a web based editor like CodePen or CodeSandbox, the following code renders icons properly:</p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"//use.fontawesome.com/releases/v5.0.7/css/all.css"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/css"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"testing.css"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/css"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"css/all.css"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1 user-scalable=no"</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fab fa-github-square"</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"https://github.com/willyblackkeez"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"profile-link"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fab fa-facebook"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p>But if you try to open the page locally in a browser, you'll still see the black rectangles instead of the icons:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/6f22c59bffe7f1b87fed6d58092f69d53e3bbd15-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Take another look at the <code>href</code> in the <code>&lt;link&gt;</code> element above. Do you see it?</p>
<p>The problem is that, when you load the page from your local file system, the browser is trying to find the Font Awesome CSS file at the root of the file system. </p>
<p>To get things working online and locally, make sure to add the URL scheme (HTTP, or better, HTTPS) to the <code>href</code>:</p>
<p><code>&lt;link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.7/css/all.css"&gt;</code></p>
<h3 id="heading-whats-going-on-here">What's going on here?</h3>
<p>When you leave off the URL scheme (<code>href="//use.fontawesome..."</code>), then the browser uses the same URL scheme the page was loaded with.</p>
<p>So if you run the page locally by running the HTML file in a browser, the <code>href</code> assumes the Font Awesome CSS is also a file that is also saved locally (<code>file:</code>).</p>
<p>Just make sure the <code>href</code> attributes for your <code>&lt;link&gt;</code> elements all point to the full URL, including the URL scheme, and you should be good to go.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ CSS Font Family and Web Safe Fonts Explained ]]>
                </title>
                <description>
                    <![CDATA[ Web Safe Fonts Web safe fonts are fonts that are included with most operating systems, the implication of such high availability is that a designer can expect typography involving web safe fonts to appear exactly as intended to most users. Below are ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/web-safe-fonts/</link>
                <guid isPermaLink="false">66c36504a63a809d273c76d9</guid>
                
                    <category>
                        <![CDATA[ fonts ]]>
                    </category>
                
                    <category>
                        <![CDATA[ toothbrush ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sat, 15 Feb 2020 19:20:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9c93740569d1a4ca32fe.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <h2 id="heading-web-safe-fonts"><strong>Web Safe Fonts</strong></h2>
<p>Web safe fonts are fonts that are included with most operating systems, the implication of such high availability is that a designer can expect typography involving web safe fonts to appear exactly as intended to most users. Below are non-exhaustive lists of some fonts that are considered web safe at the time of writing, categorized by CSS generic font families.</p>
<p>Web safe serif fonts:</p>
<ul>
<li>Georgia</li>
<li>Times New Roman</li>
</ul>
<p>Web safe sans-serif fonts:</p>
<ul>
<li>Arial</li>
<li>Tahoma</li>
<li>Trebuchet MS</li>
<li>Verdana</li>
</ul>
<p>Web safe monospaced fonts:</p>
<ul>
<li>Courier New</li>
</ul>
<p>It is worth noting that font stacks with fallback options including a generic font family should still be used even if your design uses only web safe fonts. For example:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span> {
  <span class="hljs-attribute">font-family</span>: Tahoma, Arial, sans-serif;
}
</code></pre>
<h4 id="heading-a-note-on-web-fonts"><strong>A Note on Web Fonts</strong></h4>
<p>Just because some fonts are safer than others does not mean you should confine your designs to using only web safe fonts. Modern designs with CSS can also take advantage of web fonts to ensure consistent typography across operating systems.</p>
<h2 id="heading-more-info-on-fonts">More info on fonts:</h2>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/web-fonts-in-2018-f191a48367e8/">How to load web fonts correctly</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/low-hanging-design-fruit-why-you-should-use-google-font-superfamilies-1dae04b2fc50/">Google font superfamilies</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/how-to-use-google-fonts-in-your-next-web-design-project-e1ad48f1adfa/">How to use Google Fonts in your next design project</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Add Font Awesome Icons to Your Buttons ]]>
                </title>
                <description>
                    <![CDATA[ Font Awesome is a convenient library of icons. These icons can be vector graphics stored in the .svg file format or web fonts. These icons are treated just like fonts. You can specify their size using pixels, and they will assume the font size of the... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-add-font-awesome-icons-to-your-buttons/</link>
                <guid isPermaLink="false">66c34edd0f58901a620917b2</guid>
                
                    <category>
                        <![CDATA[ Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ fonts ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sun, 05 Jan 2020 19:56:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9e2b740569d1a4ca3bbb.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Font Awesome is a convenient library of icons. These icons can be vector graphics stored in the <code>.svg</code> file format or web fonts.</p>
<p>These icons are treated just like fonts. You can specify their size using pixels, and they will assume the font size of their parent HTML elements.</p>
<h2 id="heading-basic-use">Basic use</h2>
<p>To include Font Awesome in your app or page, just add the following code to the <code>&lt;head&gt;</code> element at the top of your HTML:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"https://use.fontawesome.com/releases/v5.12.1/css/all.css"</span> <span class="hljs-attr">crossorigin</span>=<span class="hljs-string">"anonymous"</span>&gt;</span>
</code></pre>
<p>The <code>i</code> element was originally used to make other elements italic, but is now commonly used for icons. You can add the Font Awesome classes to the <code>i</code> element to turn it into an icon, for example:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-info-circle"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
</code></pre>
<p>Note that the <code>span</code> element is also acceptable for use with icons.</p>
<p>Here's how you add an icon:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-up"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
</code></pre>
<p>This will produce a simple thumbs up icon:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/02/thumbs-up.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>And here's how you would insert that icon onto a button:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">button</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-up"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span> Like
<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/02/thumbs-up-btn.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Notice that there are two parts to using an icon, the <em>style prefix</em> and the <em>icon name</em>. In the example above, the style prefix and icon name are <code>fas</code> and <code>fa-thumbs-up</code>, respectively.</p>
<p>Font Awesome offers the following style prefixes:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Style</td><td>Style Prefix</td><td>Plan Type</td></tr>
</thead>
<tbody>
<tr>
<td>Solid</td><td><code>fas</code></td><td>Free</td></tr>
<tr>
<td>Regular</td><td><code>far</code></td><td>Pro</td></tr>
<tr>
<td>Light</td><td><code>fal</code></td><td>Pro</td></tr>
<tr>
<td>Duotone</td><td><code>fad</code></td><td>Pro</td></tr>
<tr>
<td>Brands</td><td><code>fab</code></td><td>Free</td></tr>
</tbody>
</table>
</div><p>Brand icons are often submitted by the company itself, and are useful for building things like buttons for social authentication or payment. These icons include Twitter, Facebook, Spotify, Apple, and even freeCodeCamp:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fab fa-free-code-camp"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/02/fcc-fa-icon.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>While you'll only have access to solid and brand icons under the free plan, there are still many ways to style them.</p>
<h2 id="heading-styling-font-awesome-icons">Styling Font Awesome icons</h2>
<p>For simple applications, you could use inline styles:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"font-size: 3em; color: Tomato;"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-up"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/02/styled-thumbs-up.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>For sizing, you could also use Font Awesome's built in keywords:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-up fa-xs"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-up fa-sm"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-up fa-lg"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-up fa-2x"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-up fa-3x"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-up fa-5x"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-up fa-7x"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-up fa-10x"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/02/sizing-keywords.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>An important thing to remember is that FA icons inherit the <code>font-size</code> of the parent container. This means that the icons scale with any text that might be used with them, which keeps the design consistent.</p>
<p>For example, say you want to create several buttons. The default size for the buttons is quite small, so you write some CSS to increase the size of the buttons, along with the text and icons within them:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">button</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-up"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span> Like
<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">button</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-thumbs-down"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span> Dislike
<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">button</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"fas fa-share"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span> Share
<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
</code></pre>
<pre><code class="lang-css"><span class="hljs-selector-tag">button</span> {
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">1.5em</span>;
  <span class="hljs-attribute">margin</span>: <span class="hljs-number">5px</span>;
}
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/02/buttons-ex.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can also adjust an icon's size directly by targeting the icon itself and adjusting its <code>font-size</code>.</p>
<p>Font Awesome is, well, awesome! As the most popular icon toolkits, it's easy to include and use in all of your projects. Now go on icon up all the things.</p>
<h3 id="heading-more-information">More Information</h3>
<ul>
<li><a target="_blank" href="https://fontawesome.com/how-to-use/on-the-web/referencing-icons/basic-use">Font Awesome docs</a></li>
<li><a target="_blank" href="https://fontawesome.com/icons">All available Font Awesome icons</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to create a consistent custom font in an iOS app with just several lines of code ]]>
                </title>
                <description>
                    <![CDATA[ By Yuichi Fujiki In this article, you'll learn how to create a unified custom look throughout your app with these simple tricks. What we want to do In iOS, there is a mechanism called UIAppearance to define an app’s global configuration. For example,... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-use-consistent-custom-font-in-an-ios-app-e07b1ddb7a7c/</link>
                <guid isPermaLink="false">66c3559cdf235c0b59e25336</guid>
                
                    <category>
                        <![CDATA[ fonts ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ UX ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 11 Feb 2019 22:00:39 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*VaQCLYc6J3qmNdEPHmhIOA.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Yuichi Fujiki</p>
<p>In this article, you'll learn how to create a unified custom look throughout your app with these simple tricks.</p>
<h2 id="heading-what-we-want-to-do">What we want to do</h2>
<p>In iOS, there is a mechanism called <code>UIAppearance</code> to define an app’s global configuration. For example, you can set a consistent background color of the navigation bar with just one line :</p>
<pre><code>UINavigationBar.appearance().barTntColor = UIColor.blue
</code></pre><p>However, if you apply the same approach to the font like this:</p>
<pre><code>UILabel.appearance().font = UIFont(named: <span class="hljs-string">"Gills Sans"</span>, <span class="hljs-attr">size</span>: <span class="hljs-number">14</span>)
</code></pre><p>all the <code>UILabel</code> instances will indeed have “Gills Sans”, <strong>but with 14pt size as well</strong>. I don’t think any app would want to have <strong>only</strong> 14pt fonts throughout the app. Since <code>UIFont</code> always needs the size information to be initialized, there is <strong>no standard way</strong> in <code>UIKit</code> to just change the typeface without affecting the size.</p>
<p>But, don’t you want to change the font typeface without hunting down all the Swift files and Interface Builder files? Imagine you have an app with tens of screens and the product owner decides to change the font for the entire app. Or your app wants to cover another language, and you want to use another font for the language because it would look better.</p>
<p>This short article explains how you can do that with just several lines of code.</p>
<h2 id="heading-uiview-extension">UIView Extension</h2>
<p>When you create <code>UIView</code> extension and declare a property with <code>@objc</code> modifier, you can set that property through <code>UIAppearance</code>.</p>
<p>For example, if you declare a <code>UILabel</code> extension property <code>substituteFontName</code> like this:</p>
<p>You can call it in <code>AppDelegate.application(:didFinishLaunching...)</code></p>
<pre><code>UILabel.appearance().substituteFontName = <span class="hljs-string">"Gills Sans"</span>
</code></pre><p>And voilà, all <code>UILabel</code> will be in the “Gills Sans” font with appropriate sizes. ?</p>
<h2 id="heading-but-you-want-to-use-bold-font-as-well-dont-you">But you want to use bold font as well, don’t you?</h2>
<p>Life is good so far, but what if you want to specify two different variations of the same font, like bold font? You would think you can just add another extension property <code>substituteBoldFontName</code> and call it like this, right?</p>
<pre><code>UILabel.appearance().substituteFontName = fontNameUILabel.appearance().substituteBoldFontName = boldFontName
</code></pre><p>Not that easy. If you do this, then <strong>all</strong> the <code>UILabel</code> instances show up in bold font. I will explain why.</p>
<p>It seems that <code>UIAppearance</code> is just calling all the setter methods of the registered properties in the order they were registered.</p>
<p>So if we implemented the <code>UILabel</code> extension like this:</p>
<p>then setting the two properties through <code>UIAppearance</code> results in the code sequence similar to the following at every <code>UILabel</code> initialization under the hood.</p>
<pre><code>font = UIFont(name: substituteFontName, <span class="hljs-attr">size</span>: font.pointSize)font = UIFont(name: substituteBoldFontName, <span class="hljs-attr">size</span>: font.pointSize)
</code></pre><p>So, the first line is overwritten by the second line and you are going to have bold fonts everywhere. ?</p>
<h3 id="heading-what-can-you-do-about-it">What can you do about it?</h3>
<p>In order to solve this issue, we can assign proper font style based on the original font style ourselves.</p>
<p>We can change our <code>UILabel</code> extension as follows:</p>
<p>Now, the code sequence that is called at <code>UILabel</code> initialization will be as follows, and only one of the two <code>font</code> assignment will be called in a condition.</p>
<pre><code><span class="hljs-keyword">if</span> font.fontName.range(<span class="hljs-keyword">of</span>: <span class="hljs-string">"Medium"</span>) == nil {   font = UIFont(name: newValue, <span class="hljs-attr">size</span>: font.pointSize)}<span class="hljs-keyword">if</span> font.fontName.range(<span class="hljs-keyword">of</span>: <span class="hljs-string">"Medium"</span>) != nil {   font = UIFont(name: newValue, <span class="hljs-attr">size</span>: font.pointSize)}
</code></pre><p>As a result, you will have an app with beautifully unified text style while regular and bold fonts co-exist, yay! ?</p>
<p>You should be able to use the same logic to add more styles like italic fonts as well. Also, you should be able to apply the same approach to another control like <code>UITextField</code>.</p>
<p>Hope this helps fellow iOS devs, happy coding!!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How Typography Determines Readability: Serif vs. Sans Serif, and How To Combine Fonts. ]]>
                </title>
                <description>
                    <![CDATA[ By Harshita Arora #  For digital design, it’s important to know and understand how to use and how to combine different fonts. There’s a font for every mood! This post is going to give you a quick introduction to the biggest families in Typography: S... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-typography-determines-readability-serif-vs-sans-serif-and-how-to-combine-fonts-629a51ad8cce/</link>
                <guid isPermaLink="false">66c35667cf1314a450f0d69b</guid>
                
                    <category>
                        <![CDATA[ Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ fonts ]]>
                    </category>
                
                    <category>
                        <![CDATA[ style ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ typography ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 16 Jan 2018 21:55:22 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*jouWgdGEHlsARCuI9iuRDw.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Harshita Arora</p>
<p># </p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/nUU-No03jpFVHrTWqBw94WwQfB5uKgPONxEU" alt="Image" width="800" height="600" loading="lazy"></p>
<p>For digital design, it’s important to know and understand how to use and how to combine different fonts. There’s a font for every mood!</p>
<p>This post is going to give you a quick introduction to the biggest families in Typography: Serif and Sans Serif. And how, as a designer, you can choose the right fonts and combine them.</p>
<p>Let’s start!</p>
<h3 id="heading-serif-type-family">Serif Type Family</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/eaeix2N4fgkoDj0udtUmJy1AxjTeHMp5DOoo" alt="Image" width="209" height="53" loading="lazy">
<em>Example of a Serif font.</em></p>
<p>The typeface Serif is differentiated from Sans Serif by the tiny little feet-like thingy called Serifs.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/u53FoM3ihvScG8u59XLlVrC6ft9xA28hYSvS" alt="Image" width="209" height="53" loading="lazy">
<em>The areas in red are called the serif.</em></p>
<p>A lot of Serif typefaces that you’ll see will look a lot more traditional or conservative.</p>
<p><strong>Origins</strong>: The reason they have these tiny feet is actually because of stone carving. Back in the days when people needed to carve out Latin letters in stone, the designer would usually paint the letters they wanted with a paintbrush. But the stonemasons would have to carve it out from that painting. And that stone carving created these serifs on the letters.</p>
<p>People tend to use Serif typefaces for something quite serious. This is because of their traditional and conservative look and feel.</p>
<p>Serif is further divided into four typeface families.</p>
<h4 id="heading-1-old-style"><em>1. Old</em> <em>Style</em></h4>
<p>This is the oldest Serif family. It includes fonts such as Adobe Jenson, Centaur, Goudy Old style, and many more. Their typeface is modeled on what text used to look like in the 1400s. Very old-looking.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/7erShLB7mzQwdPvahu-zb6Z-jsjfidEYHrN9" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<h4 id="heading-2-transitional"><em>2. Transitional</em></h4>
<p>This is a bit more modern-looking. This typeface family includes Times New Roman, Baskerville, Georgia, etc.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/dlHWqQNT4qDvdIK400Pd6TGjM740ediuM-2l" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<h4 id="heading-3-modern"><em>3. Modern</em></h4>
<p>Even more modern-looking and classy-looking. This includes Didot, which is the typeface used for the title of Vogue magazine.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/5gK8e3uBtSdjsIOEfXubM1fqOsVIUIXkdDtt" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<h4 id="heading-4-slab-serif">4. Slab-Serif</h4>
<p>They’re a type family with thick serifs. Examples of slab-Serif typefaces include American Typewriter, Archer, etc.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/ZWOM9ApMDtBsxXShNBQjoHfYhK3lvh-vf3RZ" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<p>Now, how do you differentiate between these four major classes in the Serif Family?</p>
<p>It’s actually quite easy. Look at the first three families: Old style, Transitional, and Modern. Put them side-by-side. If you have a look at the thinnest versus the thickest part of the letters, you’ll see that as you progress from the older to the more modern types. You’ll see an increased difference in what we call the modulation of the typefaces. Concentrate on the O’s for example. Comparing the Old Style to the modern types, the thickness and thinness difference will be lesser compared to Modern.</p>
<p>And a lot of this modulation comes from when people used to write with flat-nibbed pens.</p>
<p>What about Slab-Serif?</p>
<p>If you have a look at a Slab-Serif font, you’ll see there’s pretty much zero difference between the thickest and the thinnest parts of the font.</p>
<p>And it was designed intentionally like this. It’s one of the modern members of the Serif family. Yet, it doesn’t follow the rule of “more into the future you go, the greater the difference between the thickest and thinnest part of the font.” Slab-Serif was created for newspaper printing for clearer reading when the quality of the paper used to be poor.</p>
<h3 id="heading-sans-serif-type-family">Sans-Serif Type Family</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/IVRM3NFH79gUKvhLPeMolpaddVmMm8XPdrQE" alt="Image" width="212" height="43" loading="lazy">
<em>Example of a Sans-Serif font</em></p>
<p>Sans-Serif differs from the Serif. It does not have serifs (the tiny little feet) or any decorative elements along the central beams and the top bars. Sans-Serif is slightly more modern than the serifs.</p>
<p>They’re also subdivided into four families.</p>
<h4 id="heading-1-grotesque"><em>1. Grotesque</em></h4>
<p>The oldest one. This includes News Gothic, Franklin Gothic, and more.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/-hlApvxSTW3lg6xZZl1RlmEGROJ8ptDJeRSn" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<h4 id="heading-2-neo-grotesque"><em>2. Neo-Grotesque</em>:</h4>
<p>Slightly more modern. Helvetica and Ariel are examples.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/NgkPgjVkJ1iD17VupsOBcZxRLzB7Sk2Gzb7M" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<h4 id="heading-3-humanist"><em>3. Humanist:</em></h4>
<p>Even more in the future. Gill Sans is an example.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/6P6DpKU5Uwzi2P5ItRHksqlR3Eiw3hBTMDY9" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<h4 id="heading-4-geometric"><em>4. Geometric</em>:</h4>
<p>They’re based on geometric shapes. Futura is an example.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/kLWMJzZyH-we9JQzJWD8NjomyuBEs9cteYh7" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<p>How do you differentiate between the four?</p>
<p>Now, similar to the serifs, you can move from the older Grotesque family to the Neo-Grotesque to the Humanist. You can see the difference in the thickest and the thinnest parts of the font get more and more exaggerated. When you look at the Grotesque, it’s almost equidistant at all points. And when you look at the Humanist typefaces, you start to see the variation of the modulation.</p>
<p>In a Geometric typeface, the O’s are always perfectly round. The O’s look exactly like as if you draw with a protractor. And this typeface is a bit like Slab-Serif type. Even though it’s one of the modern typefaces in the family, it bucks the trend and pretty much has no modulation and is equidistant at all points.</p>
<h3 id="heading-how-typography-determines-readability">How Typography Determines Readability</h3>
<p>Having a knowledge of the font families and their subfamilies helps with styling. But more importantly, it’s about readability. Design is both about function and form. What makes a typeface more readable?</p>
<p>Humanist Sans-Serif is considered to be more readable than Grotesque. And the reasons are:</p>
<ul>
<li>Humanist typeface has more open shapes.</li>
<li>The inter-character spacing in the Humanist typeface is more than in Grotesque, making it slightly easier to read.</li>
<li>In the Grotesque typeface, the characters are ambiguous from each other. A lowercase ‘g’ and 9 in Grotesque look pretty similar, they’re all very square, adding more confusion and making it less readable. Whereas in the Humanist typeface, you can clearly differentiate between the characters.</li>
</ul>
<p>These are some factors that make fonts more readable. Now you can choose the typeface depending on the purpose.</p>
<h3 id="heading-how-to-combine-fonts">How to combine fonts</h3>
<p>When you’re combining different typefaces, usually you’ll have a different typeface for the heading and a different one for the body. And this is to create a slight contrast and interest in your designs.</p>
<p>Some of the common rules that designers use when they combine different fonts :</p>
<ol>
<li>The Serifs and Sans-Serif work really well together. It tends to create a good design. Sans-Serif have slightly increased readability compared to Serifs. Which is why Sans-Serif is a great typeface for the body of text.<br>Don’t combine a Serif with a Serif and a Sans-Serif with a Sans-Serif because it can look a little bland and undifferentiated.</li>
<li>Too many fonts in one design is not a good thing. It ends up looking too strange. Stick to 2 fonts (one from Serif family and the other from Sans-Serif).</li>
<li>Appreciate the mood of the typeface just like colors. And don’t combine different moods together. Try to combine more modern fonts with modern fonts and older fonts with more traditional ones.<br>If you get the mood of your typefaces, you start to create some incredibly beautiful designs.<br>Things that you should keep similar: Mood and Time era of the font<br>Things that you should contrast: Serif-ness (for instance, one font should be Serif and the other Sans-Serif) and Weights.<br>Weight means how heavy or bold your text is. Most design software have a whole range of weights. For example, light, medium, bold, extra bold, and so on. Play around with different weights contrasting them to create interesting designs.</li>
</ol>
<p>NEVER EVER use — Comic Sans, Papyrus, Viner, Kristen, Curlz. No matter what you’re designing, they’ll make your designs look terrible.</p>
<h3 id="heading-tools-for-typography">Tools for Typography</h3>
<ol>
<li><a target="_blank" href="https://chrome.google.com/webstore/detail/whatfont/jabopobgcpjmedljpbcaablpmlmfcogm?hl=en">WhatFont</a><br>A chrome extension that tells you the name of a font on any website.</li>
<li><a target="_blank" href="https://www.fontsquirrel.com/">Font Squirrel</a><br>I usually download fonts from here. They’re free for commercial use.</li>
</ol>
<p>That was a brief overview of the vast field of typography. Hope you learned interesting things that you can use in your designs! :)</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
