# Anyone embedding fonts successfully?

**URL:** https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327
**Category:** Support
**Created:** [October 18, 2017, 1:00pm UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327 "2017-10-18T13:00:29Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [October 18, 2017, 1:00pm UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/1 "2017-10-18T13:00:29Z")

</div>

Continuing the discussion from [Include images and fonts in themes](https://meta.discourse.org/t/include-images-and-fonts-in-themes/62459/12):

Has anyone here successfully uploaded a web font through the customization UI and able to call it with a variable?

I have been trying to get Google Fonts working on my site but so far only can get them working by using the CSS import from Google’s servers. I’d much prefer to serve them locally. But when I try to use the SCSS variables in my CSS after uploading, they don’t seem to work at all.

Any ideas?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [October 18, 2017, 1:02pm UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/2 "2017-10-18T13:02:21Z")

</div>

I was working on a site the other day that did this…let me see if I can find it again.

Edit: @downey apologies, but I was mistaken. The font was uploaded but not in use. I can add this to my list to test, but I may not get to it until next week.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [October 18, 2017, 1:35pm UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/3 "2017-10-18T13:35:00Z")

</div>

> [@jomaxro](#):
>
> I can add this to my list to test, but I may not get to it until next week.

No worries. As mentioned, there is a workaround of serving the fonts remotely, but it’s just less than ideal. Appreciate anything you (or others) can turn up in terms of successful cases, or reproduced bugs! 🐛

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [January 23, 2018, 8:38pm UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/4 "2018-01-23T20:38:46Z")

</div>

Looping back on this - (long time, sorry!) - I found a site with uploaded fonts! To answer your question, yes you can successfully upload a font through the customization UI and able to call it with a variable.

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/b/1b431bae18c033bbb1055392db7bf8d7fd002c0c.png)

```plaintext
@font-face {
    font-family: 'colfax-bold';
    src: url($ColfaxWebBoldEOT), /* IE9 Compat Modes */
         url($ColfaxWebBoldWOFF) format('woff'); /* Modern Browsers */
}

@font-face {
    font-family: 'colfax-medium';
    src: url($ColfaxWebMediumEOT), /* IE9 Compat Modes */
         url($ColfaxWebMediumWOFF) format('woff'); /* Modern Browsers */
}

@font-face {
    font-family: 'colfax-light';
    src: url($ColfaxWebLightEOT), /* IE9 Compat Modes */
         url($ColfaxWebLightWOFF) format('woff'); /* Modern Browsers */
}

@font-face {
    font-family: 'colfax-regular';
    src: url($ColfaxWebRegularEOT), /* IE9 Compat Modes */
         url($ColfaxWebRegularWOFF) format('woff'); /* Modern Browsers */
}

@font-face {
    font-family: 'colfax-thin';
    src: url($ColfaxWebThinEOT), /* IE9 Compat Modes */
         url($ColfaxWebThinWOFF) format('woff'); /* Modern Browsers */
}

body {
    font-family: "colfax-regular", sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "colfax-light", sans-serif;
    letter-spacing: .023em;
}

/*h2 {
    font-size: 32px;
    line-height: 1.284em;
    font-weight: 500;
}*/

.stats-title, .user-stat .value {
    font-family: "colfax-medium", sans-serif;
}

.category-name {
    font-family: "colfax-medium", sans-serif;
}

.badge-category, .dropdown-select-box-row .name, .user-title {
    font-family: "colfax-medium", sans-serif;
}

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 23, 2018, 9:30pm UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/5 "2018-01-23T21:30:09Z")

</div>

This belongs in a howto/faq can you move it there?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [January 23, 2018, 9:32pm UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/6 "2018-01-23T21:32:33Z")

</div>

You wrote one already…

> [@Include assets (e.g. images, fonts) in themes and components](https://meta.discourse.org/t/include-images-and-fonts-in-themes/62459):
>
> Themes and theme components allow you to handle uploaded assets such as images and fonts. You can control what assets your theme accepts using the site setting: theme authorized extensions Including assets in themes and components For remote themes Remote themes include: Themes and components installed from the Popular list of themes Themes and components installed using the From a git repository method To upload assets to a remote theme or theme component, see [Create and share a font theme …](https://meta.discourse.org/t/create-and-share-a-font-theme-component/62462)

At the time I couldn’t confirm that it worked. This post was purely closing up a loose end.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [January 24, 2018, 4:31pm UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/7 "2018-01-24T16:31:36Z")

</div>

Hmm; thanks for this info. This is basically how I’ve set it up, but I made some tweaks in my test theme to pattern the CSS customization exactly as shown here. (Everything but setting up parallel file types with the example here.) Unfortunately, my variables still aren’t linking up to get the files to actually render the correct font.

I guess I’ll keep hacking on it with my externally-loaded fonts for now. 🙂

---

<div class="post-metadata">

### Author: ![ckshen](https://avatars.discourse-cdn.com/v4/letter/c/ad7895/32.png) [@ckshen](https://meta.discourse.org/u/ckshen)
#### Post date: [January 25, 2018, 1:02am UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/8 "2018-01-25T01:02:31Z")

</div>

Where are you uploading the fonts to? Local or s3? If the latter, CORS issue?

We embed fonts, but had to solve CORS first.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [January 25, 2018, 1:13am UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/9 "2018-01-25T01:13:43Z")

</div>

Hmm, good point. We’re using [Discourse.org](http://Discourse.org) hosting so the CDN may be at play.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [January 25, 2018, 3:58am UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/10 "2018-01-25T03:58:33Z")

</div>

The CDN _shouldn’t_ be an issue. The site I referenced is a [Discourse.org](http://Discourse.org) hosted site.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [January 25, 2018, 8:30pm UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/11 "2018-01-25T20:30:01Z")

</div>

🔎 Sounds like some more troubleshooting on my end to add to my TODO list…

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 20, 2020, 1:05am UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/12 "2020-04-20T01:05:49Z")

</div>



---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [April 20, 2020, 1:08am UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/13 "2020-04-20T01:08:41Z")

</div>

We now have a theme component that makes changing fonts very easy.

> [@Google Fonts](https://meta.discourse.org/t/google-fonts-theme-component/143720):
>
> discourse2Summary Google Fonts is a simple theme component that allows you to add a font from [Google Fonts](https://fonts.google.com/) without writing any CSS.eyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/google-fonts)hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-google-font-component](https://github.com/discourse/discourse-google-font-component)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features This component allows you to set the main site font, and optionally …

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [April 20, 2020, 1:08am UTC](https://meta.discourse.org/t/anyone-embedding-fonts-successfully/72327/14 "2020-04-20T01:08:47Z")

</div>


