Code Monkey home page Code Monkey logo

font-loading's Introduction

font-loading's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

font-loading's Issues

Class is not added to html

Hi,

Do I have to do anything else but

  • adding the script to my site
  • editing the fonts used in the lower function of the script
  • adding the @font-face rules to my site
  • adding a css class .fonts-loaded body with my font-family in it

?
I tried so, but unfortunately the class .fonts-loaded is not added to my page, so that the text won’t be show in the right font. Have you any idea how I can debug this or if I may have overseen something?

Font load fail on Firefox (downloadable font: incorrect file size in WOFF header)

Hi! I've tried this technique and got it working on Chrome. However, on Firefox, I got the following error in the console and all fonts on the page are the fallback ones.

downloadable font: incorrect file size in WOFF header..

Tried googling but it seems like most of the results are not specifically about font embedded as data uri. Any idea?

Chrome isn't interpreting the URI fonts properly

This is ... really odd, so odd that at first I thought it was what you were trying to show.

This is how the demo page for Font Events looks in Chrome 42 on Vista:
font-events

This is how the Data URIs page looks:
font-data-uris

I only see the messed-up font in Chrome -- the particular mess-up depends on whether I zoom the browser, but something is wrong at every size.

What's the difference between the URI files and the @font-face files? Whatever is causing this, I want to make sure not to do it!

Caching?

Unless I misunderstand part of the latest recommended technique, the HTML markup is different depending on whether a cookie has been set. This means that the page cannot be properly cached, and we all know how important proper caching is for performance.

Caching and cookies

I have a question about the final step of your new recommendations to set a cookie and then apply the "fonts-loaded" class immediately to the HTML in order to speed up the font-loading on subsequent page loads.

This seems unreliable to me. How do we know how long to set the cookie for? The amount of time the font files will be cached will be determined by the server's Cache-Control headers, so you'll need to ensure that your cookie's expiry length matches that value. (Right? I'm not 100% sure of this)

Or what if the user decides to clear their cache through their browser, while keeping their cookies intact? With the demo script, the function to get FontFaceObserver to fetch the webfonts would return early, and so the user would have no webfonts at all until they clear their cookies.

Could you elaborate on what other steps you need to take, or things to consider, before employing this optimization?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.