Class FontConfig.DefaultWebFontHandler

java.lang.Object
com.levigo.jadice.web.client.util.fonts.FontConfig.DefaultWebFontHandler
All Implemented Interfaces:
com.levigo.jadice.web.client.util.internal.fonts.WebFontLoader.WebFontHandler
Enclosing class:
FontConfig

protected static class FontConfig.DefaultWebFontHandler extends Object implements com.levigo.jadice.web.client.util.internal.fonts.WebFontLoader.WebFontHandler
A standard WebFontLoader implementation that has the main purpose to repaint the PageView when the loading operation has finished. The repaint is needed to be sure that Annotations are rendered with the correct font.
  • Constructor Details

    • DefaultWebFontHandler

      public DefaultWebFontHandler()
  • Method Details

    • loading

      public void loading()
      Specified by:
      loading in interface com.levigo.jadice.web.client.util.internal.fonts.WebFontLoader.WebFontHandler
    • fontLoading

      public void fontLoading(String fontFamily, String fontDescription)
      Specified by:
      fontLoading in interface com.levigo.jadice.web.client.util.internal.fonts.WebFontLoader.WebFontHandler
    • fontActive

      public void fontActive(String fontFamily, String fontDescription)
      Specified by:
      fontActive in interface com.levigo.jadice.web.client.util.internal.fonts.WebFontLoader.WebFontHandler
    • fontInactive

      public void fontInactive(String fontFamily, String fontDescription)
      Specified by:
      fontInactive in interface com.levigo.jadice.web.client.util.internal.fonts.WebFontLoader.WebFontHandler
    • active

      public void active()
      All fonts have been loaded. When this happens, repaint the PageView to be sure that annotations, which have been already created, will be rendered with the correct font.
      Specified by:
      active in interface com.levigo.jadice.web.client.util.internal.fonts.WebFontLoader.WebFontHandler
    • inactive

      public void inactive()
      All fonts have had their chance to be loaded. If for any reason a font loading has failed, there won't be any retry until the next browser refresh, so no need to wait any further.

      When this happens, repaint the pageView. That way we can be sure that annotations, which have been already created, get the right font in case that font has been loaded successfully.

      In case the font has not been loaded, the browser will decide on its own which font to use instead.

      Specified by:
      inactive in interface com.levigo.jadice.web.client.util.internal.fonts.WebFontLoader.WebFontHandler