question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOM: Font Loading API

See original GitHub issue

TypeScript Version: 2.1.1

Code

// An example usage of Font Loading API
var font = new FontFace("SinkinSans","url('SinkinSans.ttf') format('truetype')");
font.load().then(()=>{
    // font loaded
    document.fonts.add(font);
});

Expected behavior: FontFace, FontFaceSet and document.fonts must exist in the DOM typings

Actual behavior: TypeScript generates an error, it still emits but errors are shown.

More info:

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:27
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

83reactions
mrozekmacommented, Apr 16, 2019

Note for future readers: these were added to DefinitelyTyped as @types/css-font-loading-module

5reactions
mhegazycommented, Jan 18, 2017

This is still a working draft; Working Drafts are not included in lib.d.ts until they reach the Candidate Recommendation status, we would recommend putting this in definitelytyped instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Font Loading API - MDN Web Docs
The CSS Font Loading API provides events and interfaces for dynamically loading font resources.
Read more >
CSS Font Loading API - Dom - CodeProject Reference
The CSS Font Loading API provides events and interfaces for dynamically loading font resources. Interfaces. FontFace: Represents a single usable font face.
Read more >
DOM: Font Loading API · Issue #13569 · microsoft/TypeScript
Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript ; Revisit An issue worth coming back to ; Suggestion An...
Read more >
The Best Font Loading Strategies and How to Execute Them
The CSS Font Loader API has pretty good browser support, but it's a pretty cranky API. This browser support data is from Caniuse,...
Read more >
Optimize WebFont loading and rendering - web.dev
The Font Loading API # · You can hold all text rendering until the font is available. · You can implement a custom...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found