Class FontLoader
current skin's CSS file and
 updates any potentially-affected, already-drawn canvii when loading completes.  Without FontLoader, auto-sized canvii
 that use custom fonts may end up with the wrong size if a page is loaded when its custom fonts are not available in the
 browser cache.  To disable FontLoader, set  window.isc_loadCustomFonts = false  before Smart
 GWT is loaded. 
  If you want to avoid the Framework redrawing canvii after the fonts load, you may want to code your
 app to delay drawing anything until the skin fonts are loaded.  You can check isLoadingComplete() to see whether loading is done, and if it's
 not, you can  call addFontsLoadedHandler() to run code when it's done or  addFontLoadingFailedHandler() to run code if there's an error. 
Advanced Usage
FontLoader will use the new  CSS Font Loading API in
 browsers in which it's available and has proven reliable.  Otherwise, we fall back to canvas measurement techniques to
 detect loading.  To force fallback and avoid the API, set  window.isc_useCSSFontAPI = false , or
 to force the API to be used (where it exists but may be unreliable) set  window.isc_useCSSFontAPI = 
 true , before Smart GWT is loaded.  If you're loading additional style sheets, beyond the skin, that
 declare custom fonts with @font-face, you can request that the FontLoader force-load them as well by
 specifying them in window.isc_additionalFonts as an array of the font family names matching those from the
 @font-face declarations. 
Note that currently, if you have more than one font with the same font family name in your CSS, you'll need to use the CSS Font Loading API approach if you want them all loaded by the FontLoader. Under the measurement approach, the FontLoader is only able to load the default font for each font family, since it has no knowledge beyond the specified family names.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic HandlerRegistrationAdds a handler that will be called if the FontLoader fails to load any of the custom skin fonts.static HandlerRegistrationaddFontsLoadedHandler(FontsLoadedHandler handler) Adds a handler that will be called when the FontLoader finishes loading any custom skin fonts.static booleanWhether all requested custom fonts have been loaded.
- 
Constructor Details- 
FontLoaderpublic FontLoader()
 
- 
- 
Method Details- 
isLoadingCompletepublic static boolean isLoadingComplete()Whether all requested custom fonts have been loaded. If this method returns true, you know that theFontLoaderwon't need to redraw any canvii drawn afterwards, and that aFontsLoadedEventorFontLoadingFailedEventwon't arrive (it may have previously been handled).- Returns:
- whether all requested fonts have been loaded
 
- 
addFontsLoadedHandlerAdds a handler that will be called when the FontLoader finishes loading any custom skin fonts.- Parameters:
- handler- loading finished handler
- Returns:
- registration
 
- 
addFontLoadingFailedHandlerAdds a handler that will be called if the FontLoader fails to load any of the custom skin fonts.- Parameters:
- handler- loading failed handler
- Returns:
- registration
 
 
-