* Triggers the font load. Returns promise that will complete when loading * is considered to be complete. * @param {!FontConfigDef} fontConfig Config that describes the font to be * loaded. * @param {number} timeout number of milliseconds after which the font load * attempt woul
(fontConfig, timeout)
| 54 | * @return {!Promise} |
| 55 | */ |
| 56 | load(fontConfig, timeout) { |
| 57 | this.fontConfig_ = fontConfig; |
| 58 | return Services.timerFor(this.ampdoc_.win) |
| 59 | .timeoutPromise(timeout, this.load_()) |
| 60 | .then( |
| 61 | () => { |
| 62 | this.fontLoadResolved_ = true; |
| 63 | this.dispose_(); |
| 64 | }, |
| 65 | (reason) => { |
| 66 | this.fontLoadRejected_ = true; |
| 67 | this.dispose_(); |
| 68 | throw reason; |
| 69 | } |
| 70 | ); |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Triggers the font load. Returns promise that will complete when loading |
no test coverage detected