Git Product home page Git Product logo

fontloader's People

Contributors

cmandlbaur avatar godu avatar jccr avatar smnh avatar

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

fontloader's Issues

FontAwesome Support

I really like this library. Thank you for creating it. I have used it on a previous project successfully. However, I'm currently trying to use it to detect FontAwesome.

http://fortawesome.github.io/Font-Awesome/

However, the code doesn't seem to be able to detect if FontAwesome has loaded. This may be related to FontLoader.referenceText not containing any of the unicode characters for FontAwesome icons.

The message object doesn't update

Hi Guys,

This widget looks great but the complete event always shows the error:

  • "Not all fonts were loaded (0/n)"
  • notLoadedFonts: Array[0]}

The above doesn't change with the properly or wrongly loaded fonts. Only n - the number of the fonts. This relates to the provided example as well

Support font-stretch

I want to use the third character of FVD, the font-stretch. For example Din:n4c, which is normal style, normal weight, condensed. At present I get an error saying that this is not a valid font description.

Bower package

Please, provide bower package for your project, Thanks!

zoom out in browser

If you zoom out in the browser (Ctrl & - sign) and refresh the page you get an error that fonts did not load. But no issues appear if the browser is in normal view (100%).
This can be reproduced using the demo page also.
font error

Improve tests

This project could benefit by adding more testing. Would be great to integrate with Travis for automated testing as well.

Let's discuss some of the possibilities here. Things I'd like to see tested:

  • Input/options with fonts and styles
  • Raceconditions, fonts that could not be loaded

IE11 bug

FontLoader doesn't work in IE 11 because of wrong useragent detection. To detect IE11 you need to look for "Trident" in the user agent, not "MSIE".

/Trident/i.test(navigator.userAgent)

and version number regex:
var re=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})");

Unfocused window causes timeout causes error

When loadFonts is called and the window is not focused (Chrome 43), the timeout occurs. This results in the _testContainer to be detached from the DOM. Once the window regains focus, the SizeWatcher throws the Error Can't set scroll position of scroll watchers. SizeWatcher is not in the DOM tree..

Passing null for timeout will resolve this issue, but it took a while before I realised what was going on and I suspect there is a reason for the timeout feature to be enabled by default. I would like to suggest somehow detecting whether or not the window has focus, disabling the SizeWatcher, or maybe including this case in a FAQ on the bottom of the README. Or telling me what I was/am doing wrong.

Calling FontLoader multiple times

Need to load fonts by ajax call, first time function works well, second and next times function returns success instantly.

jQuery.ajax({
    type: "POST",
    url: ajax_url,
    data: 'act=getFont&name='+font,
    success: function(data) 
    {
        var fontLoader = new FontLoader([font], {
            "fontLoaded": function(font) {
            },
            "complete": function(error) {
                if (error !== null) {
                } else {
                    // All fonts were loaded
                    console.log('loaded!! ->'+font);
                    loader(0);
                    canvas.getActiveObject().setFontFamily(font);
                    canvas.renderAll();
                    },1000);
                }
            }
        }, 3000);
        fontLoader.loadFonts();
        jQuery('body').append(data);
    }
});

Why polling IE?

Hey, smnh. In your article, you provide a (seemingly) reliable method how to utilize the onresize event in IE. Why isn't this method used in the final script and polling is used instead?

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.