# Load plugin webfont

**URL:** <https://phaser.discourse.group/t/load-plugin-webfont/9702>\
**Category:** Phaser 3\
**Created:** [June 1, 2021, 8:31am UTC](https://phaser.discourse.group/t/load-plugin-webfont/9702 "2021-06-01T08:31:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![atreibout](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@atreibout](https://phaser.discourse.group/u/atreibout)\
**Post date:** [June 1, 2021, 8:31am UTC](https://phaser.discourse.group/t/load-plugin-webfont/9702/1 "2021-06-01T08:31:59Z")

</div>

Hi everybody 🙂

I try to load the “Luckiest Guy” fontfamily to my app.

I wanna use the webfont plugin here : [Webfont loader - Notes of Phaser 3](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/webfontloader/)

BUT i have an error when i do this :

in my index.html :

```javascript
window.onload = function() {
        var config = {
            type: Phaser.AUTO,
            scale: {
                mode: Phaser.Scale.FIT,
                autoCenter: Phaser.Scale.CENTER_BOTH,
                width: 800,
                height: 814//600
            },pack: {
                files: [{
                    type: 'plugin',
                    key: 'rexwebfontloaderplugin',
                    url: 'https://raw.githubusercontent.com/rexrainbow/phaser3-rex-notes/master/dist/ rexwebfontloaderplugin.min.js',
                    start: true
                }]
            },
            scene: [MainScene, jeu, map, wanted, leaderboard]
        };

        game= new Phaser.Game(config);

    };

    <script type="text/javascript" src="MainScene.js"></script>

```

and in my MainScene.js :

```javascript
class MainScene extends Phaser.Scene {

    constructor(){
        super({key: 'MainScene' });
    }
    preload () {
        this.plugins.get('rexwebfontloaderplugin').addToScene(this);

```

it’s display this :

 ![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/e/e6315252b6ce9ac2a0959760cc45acbee0e81faf.png)

what i do wrong please ?

thx !

---

<div class="post-metadata">

**Author:** ![Telinc1](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/telinc1/32/60_2.png) [@Telinc1](https://phaser.discourse.group/u/Telinc1)\
**Post date:** [June 1, 2021, 8:44am UTC](https://phaser.discourse.group/t/load-plugin-webfont/9702/2 "2021-06-01T08:44:48Z")

</div>

The `pack` options belong in the scene config, not the game config. Put them alongside the `key` in `MainScene`'s constructor.

---

<div class="post-metadata">

**Author:** ![atreibout](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@atreibout](https://phaser.discourse.group/u/atreibout)\
**Post date:** [June 1, 2021, 8:50am UTC](https://phaser.discourse.group/t/load-plugin-webfont/9702/3 "2021-06-01T08:50:17Z")

</div>

niiice thx !

But if i wanna charge the plugin in all the scene, i have to reload each time ? ok i’ll do that !

Thanks again !
