How To Add Font To Your Project
Tags: webdev, css, html, programming
Published: 2023-11-10 00:24:13

Fonts play a crucial role in the design and aesthetics of any project, whether it's a website, a mobile app, or a printed document. Selecting the right font can enhance the readability and visual appeal of your content, making it more engaging and effective. 
## Recognizing the Influence of Fonts

The way a message is interpreted can be greatly impacted by the font selection. Serif fonts are a great choice for printed items like books and formal documents because of their classic and conventional style, which frequently exudes refinement and formality. Conversely, sans-serif typefaces are popular for digital media and web content because of their crisp, modern appearance, which tends to convey simplicity and a modern edge.

## Where Can I Get Fonts?

Thankfully, a wide range of platforms provide a vast selection of fonts for any use you can think of in the digital age. Among the most well-liked font repositories are the following:

**Google Fonts**: [Google fonts](https://fonts.google.com/) is an extensive library of free and open-source fonts that are readily incorporated into online projects and provide a wide variety of styles appropriate for different design requirements.

**Adobe Fonts**: Adobe Fonts is a subscription-based service that gives users access to an extensive collection of premium [font](https://fonts.adobe.com/), enabling designers to select the ideal font for their ideas.

**DaFont**: [Dafont](https://www.dafont.com/) serves the needs of both professional and amateur designers, offering a large collection of free fonts in both traditional and current styles.

**Font Squirrel**: Font Squirrel is an online marketplace that selects premium [typefaces](https://www.fontsquirrel.com/) for business usage from different artists, guaranteeing a wide selection.

This article will walk you through the process of adding fonts to your project, covering different methods and tools you can use to achieve this goal.

## How To Add Font To Your Project

**Step 1:** I will be using Google fonts for this illustration. First and foremost, head over to the Google Font website on your web browser.

```
https://fonts.google.com/
```

![google font website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hi09atd4kh5yn6hdbkw3.png)

**Step 2:** Next, you search for the type of fonts you want.


![font type](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2fs6mjqtu6gbtw5gej07.png)

There are so many type of fonts that makes our web application visually appealing. Some of the most popular font types include;

- Serif Fonts

- Roboto

- Lato

- Poppins

- Montserrat

- Merriweather

- Monospace

For this illustration, I will be using Montserrat font. On the search bar, search for the font you prefer. 

![google font search bar](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lfxjdv1p5mcr4si6d7lr.png)

**Step 3:** When you have gotten the results of your search, select the font styles you want your font to possess.
![google font styles](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v9i6dsru1wn64sr8gpdk.png)

select all that applies to your needs and wants. For instance, you might want the font to be regular, bold, extra-bold, etc. This is mainly attributed to how you want your web application to be presented. You can select as many as you want, there are no limits.


![font style](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o18xh5aj1pur6jgurrd5.png)

When you start clicking on the '+' icon to select your preferences, you will notice a sidebar by the right will be displayed. That is there to showcase all the font styles you are selecting, as well as what to do next to incorporate the font in your web application. I selected ExtraLight 200, Regular 400, and Medium 500. By clicking on the "-" icon you can remove any font style you no longer wish to have or you mistakenly added.

**Step 4:** Now, let's move on to the part which involves incorporating your font into your web application.


![google font website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/91npimv7po6qmnw5uho2.png)

On the "use on the web" session, you can either use the "link" method or the "import" method to incorporate font into your web application.


![google font](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pptwga4bnla8nod9k0dh.png)

Using the link method, copy the code underneath, and head over to your IDE (Integrated Development Environment). I will be using VS code for this.


![vs code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gg48c6vpbtndar1lv4wt.png)

On the head session of your HTML file, paste the link there. After which you go back to your Google font. On the "CSS rules to specify family", copy the;

```
font-family: 'Montserrat', sans-serif;
```

![google font](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jl7h37jpkl75rwlp0rex.png)

After you have copied it, open your VScode, get to your CSS file, and paste it on the body element. That will automatically change the font.


![VS code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/06il452nc2iksxgbu8yq.png)

Before using the Montserrat font
![screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mnzqukejflxrrs8hc3ki.png)

After using the Montserrat font
![screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/06m61pboixhaxnxcy8wf.png).

For the import method, go back to Google font, click on the "import" session, and then copy the code underneath


![google font](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/21y8pidyg2sfv06v3fnj.png)

Head over to VScode, paste the code at the top level of your CSS file, and that's it.


![vs code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n62hz9nx60yj1s7rxysh.png)

## Conclusion

Adding the right fonts to your project can significantly enhance its visual appeal and readability. Remember to always prioritize readability, use a limited number of fonts, and ensure proper licensing when using custom fonts.