DOM: Font Loading API
See original GitHub issueTypeScript 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:
- Created 7 years ago
- Reactions:27
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Note for future readers: these were added to DefinitelyTyped as
@types/css-font-loading-module
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.