> For the complete documentation index, see [llms.txt](https://rosea.gitbook.io/alpha-moodle-theme/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rosea.gitbook.io/alpha-moodle-theme/theme-settings/google-custom-fonts-and-gdpr.md).

# Google/Custom Fonts and GDPR

## [Learn how to add self-hosted Google/Custom Font ->](#step-by-step)

### Learn more about self-hosted fonts.

{% embed url="<https://bnijenhuis.nl/notes/how-to-add-self-hosted-variable-fonts-to-your-website/>" %}

#### 1. Files to upload -> Advanced -> fontfiles

2\. TTF, OTF, WOFF, WOFF2 or SVG Converter

{% embed url="<https://transfonter.org>" %}

### **Explanation:**

Learn more How to use @font-face in CSS -> <https://css-tricks.com/snippets/css/using-font-face-in-css/>

```
@font-face {
  font-family: 'MyWebFont';
  src: url('webfont.eot'); /* IE9 Compat Modes */
  src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
       url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
       url('webfont.ttf')  format('truetype'), /* Safari, Android, iOS */
       url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
```

### Raw SCSS to add

{% hint style="warning" %}
**Change 'YOURURL' to the real one eg. for local environment:**

* localhost/....
* <https://url.com/>...
  {% endhint %}

{% code lineNumbers="true" %}

```
@font-face {
    font-family: 'Poppins', Arial, Helvetica, sans-serif;
    src: url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Medium.eot');
    src: url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Medium.eot?#iefix') format('embedded-opentype'),
        url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Medium.woff2') format('woff2'),
        url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Medium.woff') format('woff'),
        url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
  }
  
  @font-face {
    font-family: 'Poppins', Arial, Helvetica, sans-serif;
    src: url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Regular.eot');
    src: url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Regular.eot?#iefix') format('embedded-opentype'),
        url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Regular.woff2') format('woff2'),
        url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Regular.woff') format('woff'),
        url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
  }
  
  @font-face {
    font-family: 'Poppins', Arial, Helvetica, sans-serif;
    src: url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Bold.eot');
    src: url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Bold.eot?#iefix') format('embedded-opentype'),
        url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Bold.woff2') format('woff2'),
        url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Bold.woff') format('woff'),
        url('YOUR_URL/pluginfile.php/1/theme_alpha/fontfiles/0/Poppins-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
  }
  body {
        font-family: 'Poppins', Arial, Helvetica, sans-serif;
  }
```

{% endcode %}

## How to find Google Font files?

Go to Google or DuckDuckGo and search e.g *"google fonts poppins github"*

## Step by step

1. Get your custom/Google font. The layout is based on 3 font weights. Regular (400), Medium (500 or 600), Bold (700, 800 or 900). \
   **a.** If you are using *italic* style, then you have to upload italic font variants for all font weights.
2. Sometimes, users don't want to use medium weight. If it is your case, remember to set the **Font weight: Medium** to **400** *<mark style="background-color:yellow;">(Alpha -> Customization -> Google Font -> Font weight: Medium)</mark>*
3. Set the **Font Name** *(Alpha -> Customization -> Google Font - **Font Name (Body))***
4. **Upload the font package** *<mark style="background-color:yellow;">(Alpha -> Advanced -> Font files)</mark>*
5. [**Add Raw SCSS code ->**](#raw-scss-to-add)
6. **Save changes**


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://rosea.gitbook.io/alpha-moodle-theme/theme-settings/google-custom-fonts-and-gdpr.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
