Search code examples
htmlfontswebfonts

Insert local font libraries in project HTML?


everyone!

I was notified by my teacher that all requirements for external libraries must be included in the project.

How it would be possible to insert webfonts locally in my project. This is the project's index code.

<!DOCTYPE html>
<!--  This site was created in Webflow. http://www.webflow.com  -->
<!--  Last Published: Tue Sep 01 2020 19:19:23 GMT+0000 (Coordinated Universal Time)  -->
<html data-wf-page="5f15f8c6e58e17915e819bcf" data-wf-site="5f15f8c6e58e175a9e819bcd">
<head>
  <meta charset="utf-8">
  <title>Departamento Pessoal - Aula 2</title>
  <meta content="width=device-width, initial-scale=1" name="viewport">
  <meta content="Webflow" name="generator">
  <link href="css/normalize.css" rel="stylesheet" type="text/css">
  <link href="css/webflow.css" rel="stylesheet" type="text/css">
  <link href="css/move-edu-depart-pessoal-a2.webflow.css" rel="stylesheet" type="text/css">
  <script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js" type="text/javascript"></script>
  <script type="text/javascript">WebFont.load({  google: {    families: ["Montserrat:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic","Open Sans:300,300italic,400,400italic,600,600italic,700,700italic,800,800italic"]  }});</script>
  <!-- [if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js" type="text/javascript"></script><![endif] -->
  <script type="text/javascript">!function(o,c){var n=c.documentElement,t=" w-mod-";n.className+=t+"js",("ontouchstart"in o||o.DocumentTouch&&c instanceof DocumentTouch)&&(n.className+=t+"touch")}(window,document);</script>
  <link href="images/favicon.ico" rel="shortcut icon" type="image/x-icon">
  <link href="images/webclip.png" rel="apple-touch-icon">
</head>
<body class="body-inicio"  onload="startClass(002)">
  <div class="conteudo-slide">
    <div class="fundo-abertura">
      <div class="div-titulo-inicio">
        <p data-w-id="d0feee87-2d53-3876-df7e-a60a3c6aedfe" style="opacity:0" class="titulo-inicio">Departamento<br>Pessoal <br><span class="span-marcador frase-destaque">Aula 2</span></p><a data-w-id="84f0b640-f50c-9c7b-c52b-2e3e14d52f39" style="opacity:0" href="video-de-introducao.html" class="button w-button">Iniciar</a></div>
    </div>
  </div>
  <script src="https://d3e54v103j8qbb.cloudfront.net/js/jquery-3.5.1.min.dc5e7f18c8.js?site=5f15f8c6e58e175a9e819bcd" type="text/javascript" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
  <script src="js/webflow.js" type="text/javascript"></script>
  <script src="js/dBaseIO.js" type="text/javascript"></script>
  <!-- [if lte IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/placeholders/3.0.2/placeholders.min.js"></script><![endif] -->
</body>
</html>

Solution

  • What they mean is you must download a copy of the scripts you are adding, and instead of referencing them externally, you would reference them in your local folder.

    Imagine you have your HTML file stored in C:/MyWebSite/index.html. You want to create an extra folder inside MyWebSite called scripts, and you would save within this folder the scripts you are referencing here:

    <link href="css/move-edu-depart-pessoal-a2.webflow.css" rel="stylesheet" type="text/css">
    
    <script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js" type="text/javascript"></script>
    
    <!-- [if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js" type="text/javascript"></script><![endif] -->
    
    <script src="https://d3e54v103j8qbb.cloudfront.net/js/jquery-3.5.1.min.dc5e7f18c8.js?site=5f15f8c6e58e175a9e819bcd" type="text/javascript" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
    
    <!-- [if lte IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/placeholders/3.0.2/placeholders.min.js"></script><![endif] -->

    You have an example already doing this:

    <script src="js/webflow.js" type="text/javascript"></script>
    

    This is a folder in your project called js, where you have stored a file called webflow.js.