Faster Font Changes

amuzzy
amuzzy
edited April 2015 in Campaign Portal Building
Hello. I have successfully changed the fonts on my obsidian portal page, but there is a noticeable delay before the fonts are changed to the ones I have selected in the css. First a "normal" font appears, and then after about a second it gets replaced by the google font I am using. Please take a look at my CSS below, and tell me if there is a way I could better optimize it. The page is http://opportunity-knocks.obsidianportal.com. Thanks for taking the time to look at this.

/* Old West Font for Headers */
h1 { font-family: 'Rye'; }
h2 { font-family: 'Rye'; }
h3 { font-family: 'Rye'; }
h4 { font-family: 'Rye'; }
h5 { font-family: 'Rye'; }
h6 { font-family: 'Rye'; }

/* Use Paired Font for Text */
.campaign-public-layout { font-family: 'Montserrat', sans-serif; }

/* Use Paired Font for Menus */
.campaign-public-layout #campaign-nav { font-family: 'Montserrat', sans-serif; }
.campaign-dashboard-layout #dashboard-main-nav { font-family: 'Montserrat', sans-serif; }

Comments

  • Savannah
    Savannah
    Posts: 188
    I believe that's because of the page needing to load the new fonts. It happens on all of my campaigns where I use a custom font for the body text -- when I use a custom font just for the headings, I don't notice a pause.

    You can shorten your CSS like so:

    /* Old West Font for Headers */
    h1, h2, h3, h4, h5, h6 { font-family: 'Rye'; }

    /* Use Paired Font for Text and menus */
    .campaign-public-layout, .campaign-public-layout #campaign-nav, .campaign-dashboard-layout #dashboard-main-nav { font-family: 'Montserrat', sans-serif; }

    But that's not going to affect anything other than making it way easier to change things if you decide you want a different font later.

    Personally, I'd probably drop the Montserrat and just use Rye for the headings plus the default for the body. However, it's up to you whether or not you like Montserrat more than you dislike the pause before the fonts load. (I kinda hope someone comes along to tell me I'm totally wrong on this!)
  • ChainsawXIV
    ChainsawXIV
    Posts: 530
    I've noticed the same thing in the past, and done a little digging. If memory serves, it's because the way the site is loading the fonts causes them not to be cached, so they get loaded from the Google servers new each time. Annoying, certainly, but I can' understand why it's never made it to the top of the to-do list.
Sign In or Register to comment.

April 2024
Season of Strife

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions