src/third_party/specimenTools/lib/widgets/FontLister.js
/**
     * Very basic <select> interface to switch between all loaded fonts.
     * See FamilyChooser for a more advanced interface.
     */
Very basic  interface to switch between all loaded fonts.
See FamilyChooser for a more advanced interface.
Very basic interface to switch between all loaded fonts . See FamilyChooser for a more advanced interface .
function FontLister(container, pubSub, fontData, options) {
        Parent.call(this, options);
        this._container = container;
        this._pubSub = pubSub;
        this._fontsData = fontData;
        this._elements = [];
        this._selectContainer = this._container.ownerDocument.createElement('select');
        this._selectContainer.addEventListener('change', this._selectFont.bind(this));
        this._selectContainer.enabled = false;
        this._container.appendChild(this._selectContainer);
        this._pubSub.subscribe('allFontsLoaded', this._onAllFontsLoaded.bind(this));
        this._pubSub.subscribe('activateFont', this._onActivateFont.bind(this));
    }
function FontLister ( container , pubSub , fontData , options ) { Parent . call ( this , options ) ; this . _container = container ; this . _pubSub = pubSub ; this . _fontsData = fontData ; this . _elements = [ ] ; this . _selectContainer = this . _container . ownerDocument . createElement ( 'select' ) ; this . _selectContainer . addEventListener ( 'change' , this . _selectFont . bind ( this ) ) ; this . _selectContainer . enabled = false ; this . _container . appendChild ( this . _selectContainer ) ; this . _pubSub . subscribe ( 'allFontsLoaded' , this . _onAllFontsLoaded . bind ( this ) ) ; this . _pubSub . subscribe ( 'activateFont' , this . _onActivateFont . bind ( this ) ) ; }
Very basic <select> interface to switch between all loaded fonts.
Very basic <select > interface to switch between all loaded fonts .