src/third_party/specimenTools/main.js
/**
     * A very basic initialization function without passing configuration
     * with the factories array
     */
A very basic initialization function without passing configuration
with the factories array
A very basic initialization function without passing configuration with the factories array
function main(window, fontFiles) {
        var pubsub = new PubSub()
          , factories
          , fontsData = new FontsData(pubsub, {
              useLaxDetection: true, 
              overwrites: { 
                'JosefinSans': 'Testname: Josefin Sans' 
              } 
            })
          , webFontProvider = new WebFontProvider(window, pubsub, fontsData)
          ;
        factories = [
            ['family-chooser', FamilyChooser, fontsData]
          , ['glyph-table', GlyphTables]
          , ['font-data', GenericFontData, fontsData]
          , ['current-font', CurrentWebFont, webFontProvider]
          , ['type-tester', TypeTester, fontsData]
        ];
        initDocumentWidgets(window.document, factories, pubsub);
        pubsub.subscribe('allFontsLoaded', function() {
            pubsub.publish('activateFont', 0);
        });
        loadFonts.fromUrl(pubsub, fontFiles);
    }
function main ( window , fontFiles ) { var pubsub = new PubSub ( ) , factories , fontsData = new FontsData ( pubsub , { useLaxDetection : true , overwrites : { 'JosefinSans' : 'Testname: Josefin Sans' } } ) , webFontProvider = new WebFontProvider ( window , pubsub , fontsData ) ; factories = [ [ 'family-chooser' , FamilyChooser , fontsData ] , [ 'glyph-table' , GlyphTables ] , [ 'font-data' , GenericFontData , fontsData ] , [ 'current-font' , CurrentWebFont , webFontProvider ] , [ 'type-tester' , TypeTester , fontsData ] ] ; initDocumentWidgets ( window . document , factories , pubsub ) ; pubsub . subscribe ( 'allFontsLoaded' , function ( ) { pubsub . publish ( 'activateFont' , 0 ) ; } ) ; loadFonts . fromUrl ( pubsub , fontFiles ) ; }
A very basic initialization function without passing configuration
 with the factories array
A very basic initialization function without passing configuration with the factories array
// This PubSub instance is the centrally connecting element between // all modules. The order in which modules subscribe to PubSub // channels is relevant in some cases. I.e. when a subscriber is // dependant on the state of another module. // passing in this object with a font's postscript name // allows this name to be overwritten // [css-class of host element, Constructor(, further Constructor arguments, ...)] // All Constructors are given [dom-container, pubsub] as the first two arguments.