Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9089667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:12:12+00:00 2026-06-16T22:12:12+00:00

I am using Google fonts and I have code inside $(window).load(function(){… with some text

  • 0

I am using Google fonts and I have code inside $(window).load(function(){… with some text saying “loading…” everything is being rendered on the page before executing the code inside $(window).load(function(){ except the text which have CSS property font to use a Google Font.

How can I overcome this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T22:12:12+00:00Added an answer on June 16, 2026 at 10:12 pm

    You can make a non-asynchronous (a synchronous?) AJAX call to make sure the fonts are downloaded:

    xmlhttp.open('GET','path/to/needed/font',false);
    

    That will do what you are asking for. But, honestly, this is not the best user experience. I would instead recommend making a tiny SVG image of the “Loading” text and just show that image. SVG is nice because you can include the code in your HTML so you know it’s downloaded.

    If you can’t use SVGs, or just prefer JPG or PNG for whatever reason, you can embed the image data into the page: Embedding Base64 Images.

    Finally, if you don’t care about Internet Explorer, and you really don’t want to use an image, then I guess you could just put the data url into the @font-face src. For example: http://robert.accettura.com/blog/2009/07/03/optimizing-font-face-for-performance/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Google Fonts to load two fonts. Since they look absolutely horrible
I have a really bad conflict with using google-webfonts. OK here is the code:
I am having trouble getting this code to run using Google Chrome(I have not
I'm using the Raleway font provided by Google's Web Fonts and I have found
I'm working on a site design and I'm using Google Fonts, the Raleway one
I have successfully implemented code to plot multiple locations on google maps dynamically. Solution:
1) I have a site, using jQuery and the gMap Google Maps plugin. This
I have a simple service that generates a PNG image of any text, using
I'm using google font api, this code works when I move the font-family line
I'm using a JS slider called Flexslider and have discovered a strange text rendering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.