# Firefox weird text behaviour

**URL:** <https://phaser.discourse.group/t/firefox-weird-text-behaviour/191>\
**Category:** Phaser 2 / CE\
**Created:** [December 10, 2018, 1:21pm UTC](https://phaser.discourse.group/t/firefox-weird-text-behaviour/191 "2018-12-10T13:21:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mickety](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/mickety/32/158_2.png) [@Mickety](https://phaser.discourse.group/u/Mickety)\
**Post date:** [December 10, 2018, 1:21pm UTC](https://phaser.discourse.group/t/firefox-weird-text-behaviour/191/1 "2018-12-10T13:21:51Z")

</div>

Firefox 63.0.3

Text added to sprite with game.add.text(); behaves incorrectly in certain situations (which are I am looking into still)

Text’s style:

```
    let style = {
        font: "32px SomeFont, sans-serif",
        fill: "#0F0",
        align: "center"
    }

p.t = game.add.text(0, 0, "randomText", style);
p.t.anchor.set(0.5, 2);
p.addChild(p.t);

```

(p is a player sprite which text is supposed to follow which it does)

Chrome displays most text with this font 80% of times. Sometimes it falls back to default phaser font I guess.  
Firefox however seemingly never shows text, but it does - it’s just very small, about 4 pixels of font size.

Same code - different behavior. Obviously it’s supposed to be firefox’s fault but I just felt like for cross-browser compatibility purposes this should be reported.

![fontproblem](https://global.discourse-cdn.com/free1/uploads/phaser1/original/1X/6ddebe44f4d4e27f40e0de33b8bec8c8a90f8906.png)

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [December 10, 2018, 6:58pm UTC](https://phaser.discourse.group/t/firefox-weird-text-behaviour/191/2 "2018-12-10T18:58:14Z")

</div>

Looks like a webfont loading problem.

---

<div class="post-metadata">

**Author:** ![Mickety](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/mickety/32/158_2.png) [@Mickety](https://phaser.discourse.group/u/Mickety)\
**Post date:** [December 10, 2018, 7:46pm UTC](https://phaser.discourse.group/t/firefox-weird-text-behaviour/191/3 "2018-12-10T19:46:19Z")

</div>

Maybe. Keep in mind that ttf font is stored locally and I refreshed the game with both soft and hard reset (F5 and Ctrl+shift+R) multiple times.

---

<div class="post-metadata">

**Author:** ![Mickety](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/mickety/32/158_2.png) [@Mickety](https://phaser.discourse.group/u/Mickety)\
**Post date:** [December 13, 2018, 12:37am UTC](https://phaser.discourse.group/t/firefox-weird-text-behaviour/191/4 "2018-12-13T00:37:53Z")

</div>

It appears it was browser’s bug/lag whatever.  
Both chrome and firefox load the font correctly and text is displayed properly. Chrome also shows a warning but works 100% of refreshes:

```
[Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: URL To Font
```
